mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
fall back to the working MIN/MAX for int16_t
This commit is contained in:
parent
c1ca2daa00
commit
5fe311638e
1 changed files with 2 additions and 3 deletions
|
@ -3,7 +3,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@ -47,8 +46,8 @@ AgentList agentList(MIXER_LISTEN_PORT);
|
||||||
void plateauAdditionOfSamples(int16_t &mixSample, int16_t sampleToAdd) {
|
void plateauAdditionOfSamples(int16_t &mixSample, int16_t sampleToAdd) {
|
||||||
long sumSample = sampleToAdd + mixSample;
|
long sumSample = sampleToAdd + mixSample;
|
||||||
|
|
||||||
long normalizedSample = std::max((long)INT16_MAX, sumSample);
|
long normalizedSample = std::max(MAX_SAMPLE_VALUE, sumSample);
|
||||||
normalizedSample = std::min((long)INT16_MIN, sumSample);
|
normalizedSample = std::min(MIN_SAMPLE_VALUE, sumSample);
|
||||||
|
|
||||||
mixSample = normalizedSample;
|
mixSample = normalizedSample;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue