Bugfix for FS#10157 - "inaccurate seeking while paused" by Jeffrey Goode.

The pcmbuffer wasn't reset after subsequent seeks (i.e. all but the first one) when seeking while paused. This caused the buffer to be filled only once and so the wrong sound was played upon resuming. Now we make sure the pcmbuffer is always reset when not playing (a more detailed explaination is in the task).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21570 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-06-29 19:24:48 +00:00
parent 8c5c92dc2c
commit 16e339d087

View file

@ -1098,13 +1098,19 @@ static void codec_advance_buffer_loc_callback(void *ptr)
static void codec_seek_complete_callback(void)
{
logf("seek_complete");
if (pcm_is_paused())
/* If seeking-while-playing, pcm playback is actually paused (pcm_is_paused())
* but the paused flag is not set. If seeking-while-paused, the (paused) flag is
* set, but pcm playback may have actually stopped due to a previous buffer clear.
* The buffer clear below occurs with either condition. A seemless seek skips
* this section and no buffer clear occurs.
*/
if (pcm_is_paused() || paused)
{
/* If this is not a seamless seek, clear the buffer */
/* Clear the buffer */
pcmbuf_play_stop();
dsp_configure(ci.dsp, DSP_FLUSH, 0);
/* If playback was not 'deliberately' paused, unpause now */
/* If seeking-while-playing, resume pcm playback */
if (!paused)
pcmbuf_pause(false);
}