diff options
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/playback.c b/apps/playback.c index 6cd581fd1c..b2305949ac 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -290,6 +290,7 @@ static void audio_thread(void); | |||
290 | static void audio_initiate_track_change(long direction); | 290 | static void audio_initiate_track_change(long direction); |
291 | static bool audio_have_tracks(void); | 291 | static bool audio_have_tracks(void); |
292 | static void audio_reset_buffer(void); | 292 | static void audio_reset_buffer(void); |
293 | static void audio_stop_playback(void); | ||
293 | 294 | ||
294 | /* Codec thread */ | 295 | /* Codec thread */ |
295 | extern struct codec_api ci; | 296 | extern struct codec_api ci; |
@@ -1657,6 +1658,13 @@ static bool audio_load_track(size_t offset, bool start_play) | |||
1657 | logf("End-of-playlist"); | 1658 | logf("End-of-playlist"); |
1658 | memset(&lasttrack_id3, 0, sizeof(struct mp3entry)); | 1659 | memset(&lasttrack_id3, 0, sizeof(struct mp3entry)); |
1659 | filling = STATE_END_OF_PLAYLIST; | 1660 | filling = STATE_END_OF_PLAYLIST; |
1661 | |||
1662 | if (curtrack_id3.length == 0 && curtrack_id3.filesize == 0) | ||
1663 | { | ||
1664 | /* Stop playback if no valid track was found. */ | ||
1665 | audio_stop_playback(); | ||
1666 | } | ||
1667 | |||
1660 | return false; | 1668 | return false; |
1661 | } | 1669 | } |
1662 | 1670 | ||
@@ -1692,6 +1700,7 @@ static bool audio_load_track(size_t offset, bool start_play) | |||
1692 | 1700 | ||
1693 | if (track_widx == track_ridx) | 1701 | if (track_widx == track_ridx) |
1694 | { | 1702 | { |
1703 | /* TODO: Superfluos buffering call? */ | ||
1695 | buf_request_buffer_handle(tracks[track_widx].id3_hid); | 1704 | buf_request_buffer_handle(tracks[track_widx].id3_hid); |
1696 | copy_mp3entry(&curtrack_id3, bufgetid3(tracks[track_widx].id3_hid)); | 1705 | copy_mp3entry(&curtrack_id3, bufgetid3(tracks[track_widx].id3_hid)); |
1697 | curtrack_id3.offset = offset; | 1706 | curtrack_id3.offset = offset; |