mirror of
https://github.com/overte-org/overte.git
synced 2025-07-15 16:57:10 +02:00
initialize the _shouldLoopbackForAgent variable
This commit is contained in:
parent
a476c8362c
commit
a92571bdee
1 changed files with 9 additions and 11 deletions
|
@ -9,15 +9,13 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "AudioRingBuffer.h"
|
#include "AudioRingBuffer.h"
|
||||||
|
|
||||||
AudioRingBuffer::AudioRingBuffer(int ringSamples, int bufferSamples) {
|
AudioRingBuffer::AudioRingBuffer(int ringSamples, int bufferSamples) :
|
||||||
ringBufferLengthSamples = ringSamples;
|
ringBufferLengthSamples(ringSamples),
|
||||||
bufferLengthSamples = bufferSamples;
|
bufferLengthSamples(bufferSamples),
|
||||||
|
endOfLastWrite(NULL),
|
||||||
started = false;
|
started(false),
|
||||||
_shouldBeAddedToMix = false;
|
_shouldBeAddedToMix(false),
|
||||||
|
_shouldLoopbackForAgent(false) {
|
||||||
endOfLastWrite = NULL;
|
|
||||||
|
|
||||||
buffer = new int16_t[ringBufferLengthSamples];
|
buffer = new int16_t[ringBufferLengthSamples];
|
||||||
nextOutput = buffer;
|
nextOutput = buffer;
|
||||||
};
|
};
|
||||||
|
@ -27,6 +25,7 @@ AudioRingBuffer::AudioRingBuffer(const AudioRingBuffer &otherRingBuffer) {
|
||||||
bufferLengthSamples = otherRingBuffer.bufferLengthSamples;
|
bufferLengthSamples = otherRingBuffer.bufferLengthSamples;
|
||||||
started = otherRingBuffer.started;
|
started = otherRingBuffer.started;
|
||||||
_shouldBeAddedToMix = otherRingBuffer._shouldBeAddedToMix;
|
_shouldBeAddedToMix = otherRingBuffer._shouldBeAddedToMix;
|
||||||
|
_shouldLoopbackForAgent = otherRingBuffer._shouldLoopbackForAgent;
|
||||||
|
|
||||||
buffer = new int16_t[ringBufferLengthSamples];
|
buffer = new int16_t[ringBufferLengthSamples];
|
||||||
memcpy(buffer, otherRingBuffer.buffer, sizeof(int16_t) * ringBufferLengthSamples);
|
memcpy(buffer, otherRingBuffer.buffer, sizeof(int16_t) * ringBufferLengthSamples);
|
||||||
|
@ -149,8 +148,7 @@ int AudioRingBuffer::parseData(unsigned char* sourceBuffer, int numBytes) {
|
||||||
return numBytes;
|
return numBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
short AudioRingBuffer::diffLastWriteNextOutput()
|
short AudioRingBuffer::diffLastWriteNextOutput() {
|
||||||
{
|
|
||||||
if (endOfLastWrite == NULL) {
|
if (endOfLastWrite == NULL) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue