summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-03-09 13:41:33 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-03-09 13:41:33 +0000
commite4efe2fe3caeaed73c1d19b58e5ddc378d1a3e1c (patch)
treed97f336af53a1c98f86d6f61eda641116a766968 /apps/playback.c
parent68f9e1ad5772ceeddec11a602d6eaf4806adec16 (diff)
downloadrockbox-e4efe2fe3caeaed73c1d19b58e5ddc378d1a3e1c.tar.gz
rockbox-e4efe2fe3caeaed73c1d19b58e5ddc378d1a3e1c.zip
Throw in the explicit global inits that were supposed to be there too. Important for current_fd to be -1 at init.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12695 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 37a5de97b2..8fdca01458 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -189,18 +189,18 @@ bool audio_is_initialized = false;
189/* TBD: Split out "audio" and "playback" (ie. calling) threads */ 189/* TBD: Split out "audio" and "playback" (ie. calling) threads */
190 190
191/* Main state control */ 191/* Main state control */
192static volatile bool audio_codec_loaded NOCACHEBSS_ATTR;/* Codec loaded? (C/A-) */ 192static volatile bool audio_codec_loaded NOCACHEBSS_ATTR = false; /* Codec loaded? (C/A-) */
193static volatile bool playing NOCACHEBSS_ATTR; /* Is audio playing? (A) */ 193static volatile bool playing NOCACHEBSS_ATTR = false; /* Is audio playing? (A) */
194static volatile bool paused NOCACHEBSS_ATTR; /* Is audio paused? (A/C-) */ 194static volatile bool paused NOCACHEBSS_ATTR = false; /* Is audio paused? (A/C-) */
195static volatile bool filling IDATA_ATTR; /* Is file buffer refilling? (A/C-) */ 195static volatile bool filling IDATA_ATTR = false; /* Is file buffer refilling? (A/C-) */
196 196
197/* Ring buffer where compressed audio and codecs are loaded */ 197/* Ring buffer where compressed audio and codecs are loaded */
198static unsigned char *filebuf; /* Start of buffer (A/C-) */ 198static unsigned char *filebuf = NULL; /* Start of buffer (A/C-) */
199/* FIXME: make filebuflen static */ 199/* FIXME: make filebuflen static */
200size_t filebuflen; /* Size of buffer (A/C-) */ 200size_t filebuflen = 0; /* Size of buffer (A/C-) */
201/* FIXME: make buf_ridx (C/A-) */ 201/* FIXME: make buf_ridx (C/A-) */
202static volatile size_t buf_ridx IDATA_ATTR; /* Buffer read position (A/C)*/ 202static volatile size_t buf_ridx IDATA_ATTR = 0; /* Buffer read position (A/C)*/
203static volatile size_t buf_widx IDATA_ATTR; /* Buffer write position (A/C-) */ 203static volatile size_t buf_widx IDATA_ATTR = 0; /* Buffer write position (A/C-) */
204 204
205/* Possible arrangements of the buffer */ 205/* Possible arrangements of the buffer */
206#define BUFFER_STATE_TRASHED -1 /* trashed; must be reset */ 206#define BUFFER_STATE_TRASHED -1 /* trashed; must be reset */
@@ -221,24 +221,24 @@ static int buffer_state = BUFFER_STATE_TRASHED; /* Buffer state */
221 221
222/* Track info structure about songs in the file buffer (A/C-) */ 222/* Track info structure about songs in the file buffer (A/C-) */
223static struct track_info tracks[MAX_TRACK]; 223static struct track_info tracks[MAX_TRACK];
224static volatile int track_ridx; /* Track being decoded (A/C-) */ 224static volatile int track_ridx = 0; /* Track being decoded (A/C-) */
225static int track_widx; /* Track being buffered (A) */ 225static int track_widx = 0; /* Track being buffered (A) */
226 226
227static struct track_info *prev_ti; /* Previous track info pointer (A/C-) */ 227static struct track_info *prev_ti = NULL; /* Previous track info pointer (A/C-) */
228#define CUR_TI (&tracks[track_ridx]) /* Playing track info pointer (A/C-) */ 228#define CUR_TI (&tracks[track_ridx]) /* Playing track info pointer (A/C-) */
229 229
230/* Set by the audio thread when the current track information has updated 230/* Set by the audio thread when the current track information has updated
231 * and the WPS may need to update its cached information */ 231 * and the WPS may need to update its cached information */
232static bool track_changed; 232static bool track_changed = false;
233 233
234/* Information used only for filling the buffer */ 234/* Information used only for filling the buffer */
235/* Playlist steps from playing track to next track to be buffered (A) */ 235/* Playlist steps from playing track to next track to be buffered (A) */
236static int last_peek_offset; 236static int last_peek_offset = 0;
237/* Partially loaded track file handle to continue buffering (A) */ 237/* Partially loaded track file handle to continue buffering (A) */
238static int current_fd; 238static int current_fd = -1;
239 239
240/* Scrobbler support */ 240/* Scrobbler support */
241static unsigned long prev_track_elapsed; /* Previous track elapsed time (C/A-)*/ 241static unsigned long prev_track_elapsed = 0; /* Previous track elapsed time (C/A-)*/
242 242
243/* Track change controls */ 243/* Track change controls */
244static bool automatic_skip = false; /* Who initiated in-progress skip? (C/A-) */ 244static bool automatic_skip = false; /* Who initiated in-progress skip? (C/A-) */
@@ -250,20 +250,20 @@ static int wps_offset = 0;
250 250
251/* Callbacks which applications or plugins may set */ 251/* Callbacks which applications or plugins may set */
252/* When the playing track has changed from the user's perspective */ 252/* When the playing track has changed from the user's perspective */
253void (*track_changed_callback)(struct mp3entry *id3); 253void (*track_changed_callback)(struct mp3entry *id3) = NULL;
254/* When a track has been buffered */ 254/* When a track has been buffered */
255void (*track_buffer_callback)(struct mp3entry *id3, bool last_track); 255void (*track_buffer_callback)(struct mp3entry *id3, bool last_track) = NULL;
256/* When a track's buffer has been overwritten or cleared */ 256/* When a track's buffer has been overwritten or cleared */
257void (*track_unbuffer_callback)(struct mp3entry *id3, bool last_track); 257void (*track_unbuffer_callback)(struct mp3entry *id3, bool last_track) = NULL;
258 258
259/* Configuration */ 259/* Configuration */
260static size_t conf_watermark; /* Level to trigger filebuf fill (A/C) FIXME */ 260static size_t conf_watermark = 0; /* Level to trigger filebuf fill (A/C) FIXME */
261static size_t conf_filechunk; /* Largest chunk the codec accepts (A/C) FIXME */ 261static size_t conf_filechunk = 0; /* Largest chunk the codec accepts (A/C) FIXME */
262static size_t conf_preseek; /* Codec pre-seek margin (A/C) FIXME */ 262static size_t conf_preseek = 0; /* Codec pre-seek margin (A/C) FIXME */
263static size_t buffer_margin; /* Buffer margin aka anti-skip buffer (A/C-) */ 263static size_t buffer_margin = 0; /* Buffer margin aka anti-skip buffer (A/C-) */
264static bool v1first = false; /* ID3 data control, true if V1 then V2 (A) */ 264static bool v1first = false; /* ID3 data control, true if V1 then V2 (A) */
265#if MEM > 8 265#if MEM > 8
266static size_t high_watermark; /* High watermark for rebuffer (A/V/other) */ 266static size_t high_watermark = 0; /* High watermark for rebuffer (A/V/other) */
267#endif 267#endif
268 268
269/* Multiple threads */ 269/* Multiple threads */