mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-08 19:23:28 +02:00
comment out threshold frames to hopefully reduce clicks
This commit is contained in:
parent
1767f2b052
commit
3be5d60fc4
1 changed files with 13 additions and 13 deletions
|
@ -264,19 +264,19 @@ int audioCallback (const void *inputBuffer,
|
|||
}
|
||||
|
||||
// check if we have more than we need to play out
|
||||
int thresholdFrames = ceilf((PACKET_LENGTH_SAMPLES + JITTER_BUFFER_SAMPLES) / (float)PACKET_LENGTH_SAMPLES);
|
||||
int thresholdSamples = thresholdFrames * PACKET_LENGTH_SAMPLES;
|
||||
|
||||
if (ringBuffer->diffLastWriteNextOutput() > thresholdSamples) {
|
||||
// we need to push the next output forwards
|
||||
int samplesToPush = ringBuffer->diffLastWriteNextOutput() - thresholdSamples;
|
||||
|
||||
if (ringBuffer->getNextOutput() + samplesToPush > ringBuffer->getBuffer()) {
|
||||
ringBuffer->setNextOutput(ringBuffer->getBuffer() + (samplesToPush - (ringBuffer->getBuffer() + RING_BUFFER_SAMPLES - ringBuffer->getNextOutput())));
|
||||
} else {
|
||||
ringBuffer->setNextOutput(ringBuffer->getNextOutput() + samplesToPush);
|
||||
}
|
||||
}
|
||||
// int thresholdFrames = ceilf((PACKET_LENGTH_SAMPLES + JITTER_BUFFER_SAMPLES) / (float)PACKET_LENGTH_SAMPLES);
|
||||
// int thresholdSamples = thresholdFrames * PACKET_LENGTH_SAMPLES;
|
||||
//
|
||||
// if (ringBuffer->diffLastWriteNextOutput() > thresholdSamples) {
|
||||
// // we need to push the next output forwards
|
||||
// int samplesToPush = ringBuffer->diffLastWriteNextOutput() - thresholdSamples;
|
||||
//
|
||||
// if (ringBuffer->getNextOutput() + samplesToPush > ringBuffer->getBuffer()) {
|
||||
// ringBuffer->setNextOutput(ringBuffer->getBuffer() + (samplesToPush - (ringBuffer->getBuffer() + RING_BUFFER_SAMPLES - ringBuffer->getNextOutput())));
|
||||
// } else {
|
||||
// ringBuffer->setNextOutput(ringBuffer->getNextOutput() + samplesToPush);
|
||||
// }
|
||||
// }
|
||||
|
||||
for (int s = 0; s < PACKET_LENGTH_SAMPLES_PER_CHANNEL; s++) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue