mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-06 14:23:23 +02:00
Never return more than maxSamples from the audio ringbuffer
This commit is contained in:
parent
bc4a88beb7
commit
0d0a9fbd09
1 changed files with 3 additions and 2 deletions
|
@ -366,8 +366,9 @@ int InboundAudioStream::popSamples(int maxSamples, bool allOrNothing) {
|
|||
_consecutiveNotMixedCount++;
|
||||
//Kick PLC to generate a filler frame, reducing 'click'
|
||||
lostAudioData(allOrNothing ? (maxSamples - samplesAvailable) / _ringBuffer.getNumFrameSamples() : 1);
|
||||
samplesPopped = _ringBuffer.samplesAvailable();
|
||||
if (samplesPopped) {
|
||||
samplesAvailable = _ringBuffer.samplesAvailable();
|
||||
if (samplesAvailable > 0) {
|
||||
samplesPopped = std::min(samplesAvailable, maxSamples);
|
||||
popSamplesNoCheck(samplesPopped);
|
||||
} else {
|
||||
// No samples available means a packet is currently being
|
||||
|
|
Loading…
Reference in a new issue