summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/playback.c11
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-) */
247static bool playlist_end = false; /* Has the current playlist ended? (A) */ 247static bool playlist_end = false; /* Has the current playlist ended? (A) */
248static bool dir_skip = false; /* Is a directory skip pending? (A) */ 248static bool dir_skip = false; /* Is a directory skip pending? (A) */
249static bool new_playlist = false; /* Are we starting a new playlist? (A) */ 249static bool new_playlist = false; /* Are we starting a new playlist? (A) */
250/* Pending track change offset, to keep WPS responsive (A) */ 250static int wps_offset = 0; /* Pending track change offset, to keep WPS responsive (A) */
251static int wps_offset = 0; 251static 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
3411static void audio_initiate_dir_change(long direction) 3413static 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);