# HG changeset patch # User Chris Cannam # Date 1481716547 0 # Node ID 3c846b06c5180e9df41280c31e08fad1d2443d11 # Parent fc70aa31d8c56db765915664faba7a8b700e6e7b When returning the frame that we have filled to, avoid accidentally reducing the frame number (making it appear we are less filled than we really are) when we had intended to round it up to the full requested amount. Fixes some unexpected double-playback in non-looping play-selection mode. diff -r fc70aa31d8c5 -r 3c846b06c518 audio/AudioCallbackPlaySource.cpp --- a/audio/AudioCallbackPlaySource.cpp Tue Dec 13 16:23:48 2016 +0000 +++ b/audio/AudioCallbackPlaySource.cpp Wed Dec 14 11:55:47 2016 +0000 @@ -1584,6 +1584,13 @@ // thread can tell where it's got to in the playback -- so // return the full amount here frame = frame + count; + if (frame < nextChunkStart) { + frame = nextChunkStart; + } +#ifdef DEBUG_AUDIO_PLAY_SOURCE + cout << "mixModels: ending at " << nextChunkStart << ", returning frame as " + << frame << endl; +#endif return count; }