diff options
author | Magnus Holmgren <magnushol@gmail.com> | 2008-10-26 20:15:10 +0000 |
---|---|---|
committer | Magnus Holmgren <magnushol@gmail.com> | 2008-10-26 20:15:10 +0000 |
commit | 1b9991c229dbc274b4ab85dd28e490f736ba02c8 (patch) | |
tree | 5747237e6bc3de8cfa9bd792ef66f0f62bcb5403 | |
parent | e511017293264eb514721c073451232c2945241e (diff) | |
download | rockbox-1b9991c229dbc274b4ab85dd28e490f736ba02c8.tar.gz rockbox-1b9991c229dbc274b4ab85dd28e490f736ba02c8.zip |
Try to fix FS#9502: end playback properly if no valid files were found in a playlist.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18891 a1c6a512-1295-4272-9138-f99709370657
-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; |