summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/playlist.c12
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 */
104int playlist_amount(void)
105{
106 return playlist.amount;
107}
108
103int playlist_next(int steps) 109int 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