# HG changeset patch # User Chris Cannam # Date 1438764145 -3600 # Node ID 0d725dd7f99cc44c06de580173de27b34d333ab4 # Parent 4480b031fe3819540d985ebb9ff4c02d505835fe Avoid playing repeated buffer while re-seeking diff -r 4480b031fe38 -r 0d725dd7f99c audio/AudioCallbackPlaySource.cpp --- a/audio/AudioCallbackPlaySource.cpp Tue Aug 04 16:39:40 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 4480b031fe38 -r 0d725dd7f99c audio/AudioCallbackPlaySource.h --- a/audio/AudioCallbackPlaySource.h Tue Aug 04 16:39:40 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).