mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +02:00
spacing changes in Audio render
This commit is contained in:
parent
351412f6e8
commit
e0ee50fa9c
1 changed files with 2 additions and 6 deletions
|
@ -390,7 +390,6 @@ void Audio::render(int screenWidth, int screenHeight) {
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
|
|
||||||
// Show a bar with the amount of audio remaining in ring buffer beyond current playback
|
// Show a bar with the amount of audio remaining in ring buffer beyond current playback
|
||||||
float remainingBuffer = 0;
|
float remainingBuffer = 0;
|
||||||
timeval currentTime;
|
timeval currentTime;
|
||||||
|
@ -400,8 +399,6 @@ void Audio::render(int screenWidth, int screenHeight) {
|
||||||
timeLeftInCurrentBuffer = AUDIO_CALLBACK_MSECS - diffclock(&_lastCallbackTime, ¤tTime);
|
timeLeftInCurrentBuffer = AUDIO_CALLBACK_MSECS - diffclock(&_lastCallbackTime, ¤tTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /(1000.0*(float)BUFFER_LENGTH_SAMPLES/(float)SAMPLE_RATE) * frameWidth
|
|
||||||
|
|
||||||
if (_ringBuffer.getEndOfLastWrite() != NULL)
|
if (_ringBuffer.getEndOfLastWrite() != NULL)
|
||||||
remainingBuffer = _ringBuffer.diffLastWriteNextOutput() / PACKET_LENGTH_SAMPLES * AUDIO_CALLBACK_MSECS;
|
remainingBuffer = _ringBuffer.diffLastWriteNextOutput() / PACKET_LENGTH_SAMPLES * AUDIO_CALLBACK_MSECS;
|
||||||
|
|
||||||
|
@ -421,8 +418,7 @@ void Audio::render(int screenWidth, int screenHeight) {
|
||||||
|
|
||||||
if (_averagedLatency == 0.0) {
|
if (_averagedLatency == 0.0) {
|
||||||
_averagedLatency = remainingBuffer + timeLeftInCurrentBuffer;
|
_averagedLatency = remainingBuffer + timeLeftInCurrentBuffer;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
_averagedLatency = 0.99f * _averagedLatency + 0.01f * (remainingBuffer + timeLeftInCurrentBuffer);
|
_averagedLatency = 0.99f * _averagedLatency + 0.01f * (remainingBuffer + timeLeftInCurrentBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue