summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-06-29 19:24:48 +0000
committerThomas Martitz <kugel@rockbox.org>2009-06-29 19:24:48 +0000
commit16e339d087157e518b478427a5d79f8c4a8ff0c6 (patch)
treeaefc790db558ab7ab55e6e62dc566b18fc02776e /apps
parent8c5c92dc2c263a0a7821d0c6226738b6276fd6fe (diff)
downloadrockbox-16e339d087157e518b478427a5d79f8c4a8ff0c6.tar.gz
rockbox-16e339d087157e518b478427a5d79f8c4a8ff0c6.zip
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
Diffstat (limited to 'apps')
-rw-r--r--apps/playback.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 65d7fbe204..4af457cd44 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1098,13 +1098,19 @@ static void codec_advance_buffer_loc_callback(void *ptr)
1098static void codec_seek_complete_callback(void) 1098static void codec_seek_complete_callback(void)
1099{ 1099{
1100 logf("seek_complete"); 1100 logf("seek_complete");
1101 if (pcm_is_paused()) 1101 /* If seeking-while-playing, pcm playback is actually paused (pcm_is_paused())
1102 { 1102 * but the paused flag is not set. If seeking-while-paused, the (paused) flag is
1103 /* If this is not a seamless seek, clear the buffer */ 1103 * set, but pcm playback may have actually stopped due to a previous buffer clear.
1104 * The buffer clear below occurs with either condition. A seemless seek skips
1105 * this section and no buffer clear occurs.
1106 */
1107 if (pcm_is_paused() || paused)
1108 {
1109 /* Clear the buffer */
1104 pcmbuf_play_stop(); 1110 pcmbuf_play_stop();
1105 dsp_configure(ci.dsp, DSP_FLUSH, 0); 1111 dsp_configure(ci.dsp, DSP_FLUSH, 0);
1106 1112
1107 /* If playback was not 'deliberately' paused, unpause now */ 1113 /* If seeking-while-playing, resume pcm playback */
1108 if (!paused) 1114 if (!paused)
1109 pcmbuf_pause(false); 1115 pcmbuf_pause(false);
1110 } 1116 }