These attempt to flush buffers and go back to reading directly if ratios
are set back to 1. They don't work; the speed shift buffer won't line up perfectly for all channels, and the resampler would need to be lined up with the window and lerped. Make these only read directly if the buffers are empty, so these filters are cheap if their ratios are never used. Fixes clicks when moving the ratio around 1.0.
This commit is contained in:
@@ -242,7 +242,7 @@ int RageSoundReader_SpeedChange::Read( char *buf, int iFrames )
|
||||
// m_iDataBufferAvailFrames-m_iCorrelatedPos < GetWindowSizeFrames when flushing
|
||||
int iCursorAvail = GetCursorAvail();
|
||||
|
||||
if( iCursorAvail == 0 && m_fTrailingSpeedRatio == m_fSpeedRatio && m_fSpeedRatio == 1.0f )
|
||||
if( m_iDataBufferAvailFrames == 0 && m_fTrailingSpeedRatio == m_fSpeedRatio && m_fSpeedRatio == 1.0f )
|
||||
{
|
||||
/* Fast path: the buffer is empty, and we're not scaling the audio. Read directly
|
||||
* into the output buffer, to eliminate memory and copying overhead. */
|
||||
|
||||
Reference in New Issue
Block a user