summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 04096b0fea..6d277f7153 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -206,7 +206,6 @@ static bool playlist_end = false; /* Have we reached end of the cu
206static bool dir_skip = false; /* Is a directory skip pending? (A) */ 206static bool dir_skip = false; /* Is a directory skip pending? (A) */
207static bool new_playlist = false; /* Are we starting a new playlist? (A) */ 207static bool new_playlist = false; /* Are we starting a new playlist? (A) */
208static int wps_offset = 0; /* Pending track change offset, to keep WPS responsive (A) */ 208static int wps_offset = 0; /* Pending track change offset, to keep WPS responsive (A) */
209static bool quick_restart = false; /* Are we doing a quick restart for buffer resizing? (A) */
210 209
211/* Callbacks.. */ 210/* Callbacks.. */
212void (*track_changed_callback)(struct mp3entry *id3); /* ...when current track has really changed */ 211void (*track_changed_callback)(struct mp3entry *id3); /* ...when current track has really changed */
@@ -460,7 +459,7 @@ void audio_stop(void)
460 queue_post(&audio_queue, Q_AUDIO_STOP, 0); 459 queue_post(&audio_queue, Q_AUDIO_STOP, 0);
461 460
462 /* Don't return until playback has actually stopped */ 461 /* Don't return until playback has actually stopped */
463 while(playing) 462 while(playing || !queue_empty(&audio_queue))
464 yield(); 463 yield();
465} 464}
466 465
@@ -624,7 +623,6 @@ void audio_set_crossfade(int enable)
624 623
625 /* Playback has to be stopped before changing the buffer size. */ 624 /* Playback has to be stopped before changing the buffer size. */
626 gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK)); 625 gui_syncsplash(0, true, (char *)str(LANG_RESTARTING_PLAYBACK));
627 quick_restart = true;
628 audio_stop(); 626 audio_stop();
629 } 627 }
630 628
@@ -641,10 +639,7 @@ void audio_set_crossfade(int enable)
641 639
642 /* Restart playback. */ 640 /* Restart playback. */
643 if (was_playing) 641 if (was_playing)
644 {
645 audio_play(offset); 642 audio_play(offset);
646 quick_restart = false;
647 }
648} 643}
649 644
650void audio_preinit(void) 645void audio_preinit(void)
@@ -1852,11 +1847,8 @@ static void codec_thread(void)
1852 CUR_TI->id3.elapsed = CUR_TI->id3.length - pcmbuf_get_latency(); 1847 CUR_TI->id3.elapsed = CUR_TI->id3.length - pcmbuf_get_latency();
1853 sleep(1); 1848 sleep(1);
1854 } 1849 }
1855 if (!quick_restart) 1850 LOGFQUEUE("codec > audio Q_AUDIO_STOP");
1856 { 1851 queue_post(&audio_queue, Q_AUDIO_STOP, 0);
1857 LOGFQUEUE("codec > audio Q_AUDIO_STOP");
1858 queue_post(&audio_queue, Q_AUDIO_STOP, 0);
1859 }
1860 break; 1852 break;
1861 } 1853 }
1862 } 1854 }