From bbc0dab6a10fb6d1ae33e51a656832504662b8b0 Mon Sep 17 00:00:00 2001 From: zagor Date: Thu, 24 Apr 2003 17:31:36 +0000 Subject: [PATCH] Changed to runtime playlist initialization git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3602 a1c6a512-1295-4272-9138-f99709370657 --- apps/main.c | 2 ++ apps/playlist.c | 22 ++++++---------------- apps/playlist.h | 1 + 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/apps/main.c b/apps/main.c index e33e2bd5a..af85db224 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 48de9dd68..748c2ce52 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 9f70b469a..2ea4452cc 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, -- 2.11.4.GIT