summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/playback.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/playback.c b/apps/playback.c
index c6c77fd58e..85f708f95d 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1283,6 +1283,7 @@ bool codec_request_next_track_callback(void)
1283 if (tracks[track_ridx].filesize == 0) { 1283 if (tracks[track_ridx].filesize == 0) {
1284 logf("Loading from disk..."); 1284 logf("Loading from disk...");
1285 new_track = 0; 1285 new_track = 0;
1286 last_index = -1;
1286 queue_post(&audio_queue, AUDIO_PLAY, 0); 1287 queue_post(&audio_queue, AUDIO_PLAY, 0);
1287 return false; 1288 return false;
1288 } 1289 }
@@ -1303,6 +1304,7 @@ bool codec_request_next_track_callback(void)
1303 /*+ (off_t)tracks[track_ridx].codecsize*/ > codecbuflen) { 1304 /*+ (off_t)tracks[track_ridx].codecsize*/ > codecbuflen) {
1304 logf("Loading from disk..."); 1305 logf("Loading from disk...");
1305 new_track = 0; 1306 new_track = 0;
1307 last_index = -1;
1306 queue_post(&audio_queue, AUDIO_PLAY, 0); 1308 queue_post(&audio_queue, AUDIO_PLAY, 0);
1307 return false; 1309 return false;
1308 } 1310 }
@@ -1408,6 +1410,15 @@ void audio_thread(void)
1408 queue_wait_w_tmo(&audio_queue, &ev, 0); 1410 queue_wait_w_tmo(&audio_queue, &ev, 0);
1409 switch (ev.id) { 1411 switch (ev.id) {
1410 case AUDIO_PLAY: 1412 case AUDIO_PLAY:
1413 /* Refuse to start playback if we are already playing
1414 the requested track. This is needed because when skipping
1415 tracks fast, AUDIO_PLAY commands will get queued with the
1416 the same track and playback will stutter. */
1417 if (last_index == playlist_get_display_index() && playing) {
1418 logf("already playing req. track");
1419 break ;
1420 }
1421
1411 logf("starting..."); 1422 logf("starting...");
1412 playing = true; 1423 playing = true;
1413 paused = false; 1424 paused = false;