From 4db3e8965270dfe813a14c5ee9bcd0b645eb2edf Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Thu, 1 Sep 2011 12:15:43 +0000 Subject: Shuffle some functions around so that interfacing with playback.c in particular isn't required. Though playback does finish the audio init, pcm doesn't care who does it. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30403 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 13 ++----------- apps/playback.h | 1 - apps/radio/radio.c | 2 +- apps/recorder/recording.c | 2 +- 4 files changed, 4 insertions(+), 14 deletions(-) (limited to 'apps') diff --git a/apps/playback.c b/apps/playback.c index 9fd25b975d..dbe28dd1c4 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -183,8 +183,7 @@ static struct albumart_slot /* Buffer and thread state tracking */ static enum filling_state { - STATE_BOOT = 0, /* audio thread is not ready yet */ - STATE_IDLE, /* audio is stopped: nothing to do */ + STATE_IDLE = 0, /* audio is stopped: nothing to do */ STATE_FILLING, /* adding tracks to the buffer */ STATE_FULL, /* can't add any more tracks */ STATE_END_OF_PLAYLIST, /* all remaining tracks have been added */ @@ -194,7 +193,7 @@ static enum filling_state #if (CONFIG_PLATFORM & PLATFORM_NATIVE) STATE_USB, /* USB mode, ignore most messages */ #endif -} filling = STATE_BOOT; +} filling = STATE_IDLE; /* Track info - holds information about each track in the buffer */ struct track_info @@ -2917,8 +2916,6 @@ static void audio_thread(void) pcm_postinit(); - filling = STATE_IDLE; - while (1) { switch (filling) @@ -3717,12 +3714,6 @@ unsigned long audio_prev_elapsed(void) return prev_track_elapsed; } -/* Is the audio thread ready to accept commands? */ -bool audio_is_thread_ready(void) -{ - return filling != STATE_BOOT; -} - /* Return total file buffer length after accounting for the talk buf */ size_t audio_get_filebuflen(void) { diff --git a/apps/playback.h b/apps/playback.h index 793055f98c..6e57c03fad 100644 --- a/apps/playback.h +++ b/apps/playback.h @@ -70,7 +70,6 @@ struct bufopen_bitmap_data { #endif /* Functions */ -bool audio_is_thread_ready(void); int audio_track_count(void); long audio_filebufused(void); void audio_pre_ff_rewind(void); diff --git a/apps/radio/radio.c b/apps/radio/radio.c index 1a77709f9c..4524707289 100644 --- a/apps/radio/radio.c +++ b/apps/radio/radio.c @@ -418,7 +418,7 @@ void radio_screen(void) /* turn on radio */ #if CONFIG_CODEC == SWCODEC /* This should be done before touching audio settings */ - while (!audio_is_thread_ready()) + while (!pcm_is_initialized()) sleep(0); audio_set_input_source(AUDIO_SRC_FMRADIO, diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 453b2fc42d..d706899b1c 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -1074,7 +1074,7 @@ bool recording_screen(bool no_source) #if CONFIG_CODEC == SWCODEC /* This should be done before touching audio settings */ - while (!audio_is_thread_ready()) + while (!pcm_is_initialized()) sleep(0); /* recording_menu gets messed up: so prevent manus talking */ -- cgit v1.2.3