diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-10-11 07:55:45 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-10-11 07:55:45 +0000 |
commit | 72d2535a49cca00b37758d6d96426444a1d1ed05 (patch) | |
tree | 59e4b6271531b4b4e84594fa059f4eee69189b05 /firmware | |
parent | 6a4ed54e966089ca3d7a11eea6c5c7b36a764771 (diff) | |
download | rockbox-72d2535a49cca00b37758d6d96426444a1d1ed05.tar.gz rockbox-72d2535a49cca00b37758d6d96426444a1d1ed05.zip |
Stepping backwards over non-existing files now works. Thanks to Christian Marg for pinpointing the problem.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5249 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/mpeg.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index 3507d2b2f4..7969d5970b 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c | |||
@@ -17,6 +17,7 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | #include <stdbool.h> | 19 | #include <stdbool.h> |
20 | #include <stdlib.h> | ||
20 | #include "config.h" | 21 | #include "config.h" |
21 | #include "debug.h" | 22 | #include "debug.h" |
22 | #include "panic.h" | 23 | #include "panic.h" |
@@ -855,10 +856,13 @@ static int new_file(int steps) | |||
855 | mpeg_file = open(trackname, O_RDONLY); | 856 | mpeg_file = open(trackname, O_RDONLY); |
856 | if(mpeg_file < 0) { | 857 | if(mpeg_file < 0) { |
857 | DEBUGF("Couldn't open file: %s\n",trackname); | 858 | DEBUGF("Couldn't open file: %s\n",trackname); |
858 | steps++; | 859 | if(steps < 0) |
860 | steps--; | ||
861 | else | ||
862 | steps++; | ||
859 | 863 | ||
860 | /* Bail out if no file could be opened */ | 864 | /* Bail out if no file could be opened */ |
861 | if(steps > max_steps) | 865 | if(abs(steps) > max_steps) |
862 | return -1; | 866 | return -1; |
863 | } | 867 | } |
864 | else | 868 | else |