diff options
-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 |