From a5c0fad61763d2e9f2648c1afdd6f88f6d36859b Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 9 Oct 2002 13:36:49 +0000 Subject: 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 --- apps/playlist.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'apps') 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) 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; -- cgit v1.2.3