summaryrefslogtreecommitdiff
path: root/firmware/mpeg.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-23 07:56:36 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-23 07:56:36 +0000
commit57392acd18468a4530a63d379cc7534b2640e6b3 (patch)
tree0e8886401766cfe6bd2518ffd6f30ab1eff5560f /firmware/mpeg.c
parent3625dedcce4a0ac81e74b0f0889ee741e7e2c0cf (diff)
the simulator code now deals better with playlist_next() returning NULL
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1941 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r--firmware/mpeg.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index e7c3638da9..6f2b3dfafe 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -1246,17 +1246,17 @@ void mpeg_play(int offset)
do {
trackname = playlist_next( steps, NULL );
- if ( trackname ) {
- if(mp3info(&taginfo, trackname)) {
- /* bad mp3, move on */
- steps++;
- continue;
- }
- taginfo.offset = offset;
- set_elapsed(&taginfo);
- playing = true;
+ if (!trackname)
break;
+ if(mp3info(&taginfo, trackname)) {
+ /* bad mp3, move on */
+ steps++;
+ continue;
}
+ taginfo.offset = offset;
+ set_elapsed(&taginfo);
+ playing = true;
+ break;
} while(1);
#else
queue_post(&mpeg_queue, MPEG_PLAY, (void*)offset);
@@ -1302,6 +1302,8 @@ void mpeg_next(void)
do {
file = playlist_next(steps, NULL);
+ if(!file)
+ break;
if(mp3info(&taginfo, file)) {
steps++;
continue;
@@ -1323,6 +1325,8 @@ void mpeg_prev(void)
do {
file = playlist_next(steps, NULL);
+ if(!file)
+ break;
if(mp3info(&taginfo, file)) {
steps--;
continue;