diff options
author | Steve Bavin <pondlife@pondlife.me> | 2007-07-31 07:57:59 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2007-07-31 07:57:59 +0000 |
commit | 93b3fb334b90d5bc6b4f0f9acfa9477413342309 (patch) | |
tree | 513dab507b15d0aabbdbdbcd9afe404d450e8f7b /apps | |
parent | f48d0ef7a23af5da9ddd6e8f5289e48f90c62ddd (diff) | |
download | rockbox-93b3fb334b90d5bc6b4f0f9acfa9477413342309.tar.gz rockbox-93b3fb334b90d5bc6b4f0f9acfa9477413342309.zip |
FS#6266 - flush PCM buffers if the user skips while paused. FixesFS#5747.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14090 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playback.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c index 98f30e918c..6c9c0065cd 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -247,8 +247,8 @@ static bool automatic_skip = false; /* Who initiated in-progress skip? (C/A-) */ | |||
247 | static bool playlist_end = false; /* Has the current playlist ended? (A) */ | 247 | static bool playlist_end = false; /* Has the current playlist ended? (A) */ |
248 | static bool dir_skip = false; /* Is a directory skip pending? (A) */ | 248 | static bool dir_skip = false; /* Is a directory skip pending? (A) */ |
249 | static bool new_playlist = false; /* Are we starting a new playlist? (A) */ | 249 | static bool new_playlist = false; /* Are we starting a new playlist? (A) */ |
250 | /* Pending track change offset, to keep WPS responsive (A) */ | 250 | static int wps_offset = 0; /* Pending track change offset, to keep WPS responsive (A) */ |
251 | static int wps_offset = 0; | 251 | static bool skipped_during_pause = false; /* Do we need to clear the PCM buffer when playback resumes (A) */ |
252 | 252 | ||
253 | /* Callbacks which applications or plugins may set */ | 253 | /* Callbacks which applications or plugins may set */ |
254 | /* When the playing track has changed from the user's perspective */ | 254 | /* When the playing track has changed from the user's perspective */ |
@@ -3406,6 +3406,8 @@ static void audio_initiate_track_change(long direction) | |||
3406 | playlist_end = false; | 3406 | playlist_end = false; |
3407 | ci.new_track += direction; | 3407 | ci.new_track += direction; |
3408 | wps_offset -= direction; | 3408 | wps_offset -= direction; |
3409 | if (paused) | ||
3410 | skipped_during_pause = true; | ||
3409 | } | 3411 | } |
3410 | 3412 | ||
3411 | static void audio_initiate_dir_change(long direction) | 3413 | static void audio_initiate_dir_change(long direction) |
@@ -3413,6 +3415,8 @@ static void audio_initiate_dir_change(long direction) | |||
3413 | playlist_end = false; | 3415 | playlist_end = false; |
3414 | dir_skip = true; | 3416 | dir_skip = true; |
3415 | ci.new_track = direction; | 3417 | ci.new_track = direction; |
3418 | if (paused) | ||
3419 | skipped_during_pause = true; | ||
3416 | } | 3420 | } |
3417 | 3421 | ||
3418 | /* | 3422 | /* |
@@ -3632,6 +3636,9 @@ static void audio_thread(void) | |||
3632 | 3636 | ||
3633 | case Q_AUDIO_PAUSE: | 3637 | case Q_AUDIO_PAUSE: |
3634 | LOGFQUEUE("audio < Q_AUDIO_PAUSE"); | 3638 | LOGFQUEUE("audio < Q_AUDIO_PAUSE"); |
3639 | if (!(bool) ev.data && skipped_during_pause && !pcmbuf_is_crossfade_active()) | ||
3640 | pcmbuf_play_stop(); /* Flush old track on resume after skip */ | ||
3641 | skipped_during_pause = false; | ||
3635 | if (!playing) | 3642 | if (!playing) |
3636 | break; | 3643 | break; |
3637 | pcmbuf_pause((bool)ev.data); | 3644 | pcmbuf_pause((bool)ev.data); |