From 3aab18a5e8aa0fd3c14386ec6b197d93a20c9c3f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 15 Oct 2002 13:07:32 +0000 Subject: Prevent the simulator from locking on play in a dir with all-empty files. This doesn't do quite the same as the real code, but at least it doesn't loop forever now. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2664 a1c6a512-1295-4272-9138-f99709370657 --- firmware/mpeg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'firmware/mpeg.c') diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 606b724241..a6c6783beb 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -1512,7 +1512,8 @@ void mpeg_play(int offset) break; if(mp3info(&taginfo, trackname)) { /* bad mp3, move on */ - steps++; + if(++steps > playlist_amount()) + break; continue; } playlist_next(steps); @@ -1575,7 +1576,8 @@ void mpeg_next(void) if(!file) break; if(mp3info(&taginfo, file)) { - steps++; + if(++steps > playlist_amount()) + break; continue; } index = playlist_next(steps); -- cgit v1.2.3