mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:17:38 +02:00
max desired must be one less than the max frames in our ringbuffer
This commit is contained in:
parent
6434c0a2a4
commit
355ab2cb95
2 changed files with 4 additions and 3 deletions
|
@ -122,9 +122,6 @@ qint64 AudioRingBuffer::writeData(const char* data, qint64 maxSize) {
|
||||||
|
|
||||||
int samplesToCopy = std::min((quint64)(maxSize / sizeof(int16_t)), (quint64)_sampleCapacity);
|
int samplesToCopy = std::min((quint64)(maxSize / sizeof(int16_t)), (quint64)_sampleCapacity);
|
||||||
|
|
||||||
std::less<int16_t*> less;
|
|
||||||
std::less_equal<int16_t*> lessEqual;
|
|
||||||
|
|
||||||
if (_hasStarted && samplesToCopy > _sampleCapacity - samplesAvailable()) {
|
if (_hasStarted && samplesToCopy > _sampleCapacity - samplesAvailable()) {
|
||||||
// this read will cross the next output, so call us starved and reset the buffer
|
// this read will cross the next output, so call us starved and reset the buffer
|
||||||
qDebug() << "Filled the ring buffer. Resetting.";
|
qDebug() << "Filled the ring buffer. Resetting.";
|
||||||
|
|
|
@ -243,5 +243,9 @@ void PositionalAudioRingBuffer::updateDesiredJitterBufferFrames() {
|
||||||
if (_desiredJitterBufferFrames < 1) {
|
if (_desiredJitterBufferFrames < 1) {
|
||||||
_desiredJitterBufferFrames = 1;
|
_desiredJitterBufferFrames = 1;
|
||||||
}
|
}
|
||||||
|
const int maxDesired = RING_BUFFER_LENGTH_FRAMES - 1;
|
||||||
|
if (_desiredJitterBufferFrames > maxDesired) {
|
||||||
|
_desiredJitterBufferFrames = maxDesired;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue