diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-10-09 13:36:49 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-10-09 13:36:49 +0000 |
commit | a5c0fad61763d2e9f2648c1afdd6f88f6d36859b (patch) | |
tree | fd1b8e10d178c4e7185ae57670511ac48a9ad838 | |
parent | 33060d00c20c81a7600914b14c3e4838c0b4a9f6 (diff) | |
download | rockbox-a5c0fad61763d2e9f2648c1afdd6f88f6d36859b.tar.gz rockbox-a5c0fad61763d2e9f2648c1afdd6f88f6d36859b.zip |
added playlist_amount(), no longer trying to stop insane looping in the
playlist code, that should be done by the mpeg thread (or somewhere). The
playlist code just can't know when to stop.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2548 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/playlist.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 23c3f5d606..8483d70293 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -100,6 +100,12 @@ static int get_next_index(int steps) | |||
100 | return next_index; | 100 | return next_index; |
101 | } | 101 | } |
102 | 102 | ||
103 | /* the mpeg thread might ask us */ | ||
104 | int playlist_amount(void) | ||
105 | { | ||
106 | return playlist.amount; | ||
107 | } | ||
108 | |||
103 | int playlist_next(int steps) | 109 | int playlist_next(int steps) |
104 | { | 110 | { |
105 | playlist.index = get_next_index(steps); | 111 | playlist.index = get_next_index(steps); |
@@ -118,13 +124,9 @@ char* playlist_peek(int steps) | |||
118 | char *dir_end; | 124 | char *dir_end; |
119 | int index; | 125 | int index; |
120 | 126 | ||
121 | if(abs(steps) > playlist.amount) | ||
122 | /* prevent madness when all files are empty/bad */ | ||
123 | return NULL; | ||
124 | |||
125 | index = get_next_index(steps); | 127 | index = get_next_index(steps); |
126 | if (index >= 0) | 128 | if (index >= 0) |
127 | seek = playlist.indices[index]; | 129 | seek = playlist.indices[index]; |
128 | else | 130 | else |
129 | return NULL; | 131 | return NULL; |
130 | 132 | ||