summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-10-09 13:36:49 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-10-09 13:36:49 +0000
commita5c0fad61763d2e9f2648c1afdd6f88f6d36859b (patch)
treefd1b8e10d178c4e7185ae57670511ac48a9ad838
parent33060d00c20c81a7600914b14c3e4838c0b4a9f6 (diff)
downloadrockbox-a5c0fad61763d2e9f2648c1afdd6f88f6d36859b.zip
rockbox-a5c0fad61763d2e9f2648c1afdd6f88f6d36859b.tar.gz
rockbox-a5c0fad61763d2e9f2648c1afdd6f88f6d36859b.tar.bz2
rockbox-a5c0fad61763d2e9f2648c1afdd6f88f6d36859b.tar.xz
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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 23c3f5d..8483d70 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -100,6 +100,12 @@ static int get_next_index(int steps)
return next_index;
}
+/* the mpeg thread might ask us */
+int playlist_amount(void)
+{
+ return playlist.amount;
+}
+
int playlist_next(int steps)
{
playlist.index = get_next_index(steps);
@@ -118,13 +124,9 @@ char* playlist_peek(int steps)
char *dir_end;
int index;
- if(abs(steps) > playlist.amount)
- /* prevent madness when all files are empty/bad */
- return NULL;
-
index = get_next_index(steps);
if (index >= 0)
- seek = playlist.indices[index];
+ seek = playlist.indices[index];
else
return NULL;