summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/main.c2
-rw-r--r--apps/playlist.c22
-rw-r--r--apps/playlist.h1
3 files changed, 9 insertions, 16 deletions
diff --git a/apps/main.c b/apps/main.c
index e33e2bd..af85db2 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -48,6 +48,7 @@
#include "font.h"
#include "language.h"
#include "wps-display.h"
+#include "playlist.h"
char appsversion[]=APPSVERSION;
@@ -176,6 +177,7 @@ void init(void)
status_init();
usb_start_monitoring();
power_init();
+ playlist_init();
}
int main(void)
diff --git a/apps/playlist.c b/apps/playlist.c
index 48de9dd..748c2ce 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -38,22 +38,7 @@
#include "lang.h"
-static struct playlist_info playlist={
- "", /* filename */
- -1, /* fd */
- 0, /* dirlen */
- {0}, /* indices[] */
- 0, /* index */
- 0, /* first_index */
- 0, /* seed */
- 0, /* amount */
- false, /* in_ram */
- {0}, /* queue_indices[] */
- 0, /* last_queue_index */
- 0, /* queue_index */
- 0, /* num_queued */
- 0 /* start_queue */
-};
+static struct playlist_info playlist;
#define QUEUE_FILE ROCKBOX_DIR "/.queue_file"
@@ -65,6 +50,11 @@ static int playlist_end_pos = 0;
static char now_playing[MAX_PATH+1];
+void playlist_init(void)
+{
+ playlist.fd = -1;
+}
+
/*
* remove any files and indices associated with the playlist
*/
diff --git a/apps/playlist.h b/apps/playlist.h
index 9f70b46..2ea4452 100644
--- a/apps/playlist.h
+++ b/apps/playlist.h
@@ -49,6 +49,7 @@ struct playlist_info
extern struct playlist_info playlist;
extern bool playlist_shuffle;
+void playlist_init(void);
int play_list(char *dir, char *file, int start_index,
bool shuffled_index, int start_offset,
int random_seed, int first_index, int queue_resume,