# HG changeset patch # User Chris Cannam # Date 1438764145 -3600 # Node ID c6094bca34f427c5c7280859cd6c1bcad77637d8 # Parent 56acd9368532e97fe405ab51c3769f017654b3f4 Avoid playing repeated buffer while re-seeking diff -r 56acd9368532 -r c6094bca34f4 audio/AudioCallbackPlaySource.cpp --- a/audio/AudioCallbackPlaySource.cpp Tue Aug 04 13:27:42 2015 +0100 +++ b/audio/AudioCallbackPlaySource.cpp Wed Aug 05 09:42:25 2015 +0100 @@ -1111,7 +1111,7 @@ emit activity(tr("Change time-stretch factor to %1").arg(factor)); } -void +int AudioCallbackPlaySource::getSourceSamples(int count, float **buffer) { if (!m_playing) { @@ -1123,7 +1123,7 @@ buffer[ch][i] = 0.0; } } - return; + return 0; } #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING @@ -1159,7 +1159,7 @@ } } - if (count == 0) return; + if (count == 0) return 0; RubberBandStretcher *ts = m_timeStretcher; RubberBandStretcher *ms = m_monoStretcher; @@ -1229,7 +1229,7 @@ m_condition.wakeAll(); - return; + return got; } int channels = getTargetChannelCount(); @@ -1321,7 +1321,7 @@ m_condition.wakeAll(); - return; + return count; } void diff -r 56acd9368532 -r c6094bca34f4 audio/AudioCallbackPlaySource.h --- a/audio/AudioCallbackPlaySource.h Tue Aug 04 13:27:42 2015 +0100 +++ b/audio/AudioCallbackPlaySource.h Wed Aug 05 09:42:25 2015 +0100 @@ -219,7 +219,7 @@ * audio data, in all channels. This may safely be called from a * realtime thread. */ - virtual void getSourceSamples(int count, float **buffer); + virtual int getSourceSamples(int count, float **buffer); /** * Set the time stretcher factor (i.e. playback speed).