mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 04:57:23 +02:00
Merge branch 'master' of https://github.com/worklist/hifi
This commit is contained in:
commit
94754963ad
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
|
// 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 thresholdFrames = ceilf((PACKET_LENGTH_SAMPLES + JITTER_BUFFER_SAMPLES) / (float)PACKET_LENGTH_SAMPLES);
|
||||||
int thresholdSamples = thresholdFrames * PACKET_LENGTH_SAMPLES;
|
// int thresholdSamples = thresholdFrames * PACKET_LENGTH_SAMPLES;
|
||||||
|
//
|
||||||
if (ringBuffer->diffLastWriteNextOutput() > thresholdSamples) {
|
// if (ringBuffer->diffLastWriteNextOutput() > thresholdSamples) {
|
||||||
// we need to push the next output forwards
|
// // we need to push the next output forwards
|
||||||
int samplesToPush = ringBuffer->diffLastWriteNextOutput() - thresholdSamples;
|
// int samplesToPush = ringBuffer->diffLastWriteNextOutput() - thresholdSamples;
|
||||||
|
//
|
||||||
if (ringBuffer->getNextOutput() + samplesToPush > ringBuffer->getBuffer()) {
|
// if (ringBuffer->getNextOutput() + samplesToPush > ringBuffer->getBuffer()) {
|
||||||
ringBuffer->setNextOutput(ringBuffer->getBuffer() + (samplesToPush - (ringBuffer->getBuffer() + RING_BUFFER_SAMPLES - ringBuffer->getNextOutput())));
|
// ringBuffer->setNextOutput(ringBuffer->getBuffer() + (samplesToPush - (ringBuffer->getBuffer() + RING_BUFFER_SAMPLES - ringBuffer->getNextOutput())));
|
||||||
} else {
|
// } else {
|
||||||
ringBuffer->setNextOutput(ringBuffer->getNextOutput() + samplesToPush);
|
// ringBuffer->setNextOutput(ringBuffer->getNextOutput() + samplesToPush);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
for (int s = 0; s < PACKET_LENGTH_SAMPLES_PER_CHANNEL; s++) {
|
for (int s = 0; s < PACKET_LENGTH_SAMPLES_PER_CHANNEL; s++) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue