spacing changes in Audio render

This commit is contained in:
Stephen Birarda 2013-05-15 12:38:08 -07:00
parent 351412f6e8
commit e0ee50fa9c

View file

@ -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, &currentTime); timeLeftInCurrentBuffer = AUDIO_CALLBACK_MSECS - diffclock(&_lastCallbackTime, &currentTime);
} }
// /(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);
} }