diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2011-10-09 16:19:51 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2011-10-09 16:19:51 +0000 |
| commit | 0aa12a9717cbd73b8cbd3048737dc5d81357a50b (patch) | |
| tree | dd7b97ca851abba71aac72e6bbb104a61cc46a02 | |
| parent | 889690c0f60a2ce2cdfd985895d0484c78083df1 (diff) | |
| download | rockbox-0aa12a9717cbd73b8cbd3048737dc5d81357a50b.zip rockbox-0aa12a9717cbd73b8cbd3048737dc5d81357a50b.tar.gz rockbox-0aa12a9717cbd73b8cbd3048737dc5d81357a50b.tar.bz2 rockbox-0aa12a9717cbd73b8cbd3048737dc5d81357a50b.tar.xz | |
Another fix for audio_get_buffer() on hwcodec by Thomas Martitz.
Some functions must only be called when audio is already initialized, due to talk <-> audio interdependency, same as on swcodec.
This makes hwcodec boot and play music again. Voice menus also working again, talk clips not yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30738 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/mpeg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/mpeg.c b/apps/mpeg.c index b7db602..9048226 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c @@ -142,6 +142,7 @@ static bool checked_for_cuesheet = false; static const char mpeg_thread_name[] = "mpeg"; static unsigned int audio_thread_id; +static bool audio_is_initialized; static unsigned int mpeg_errno; static bool playing = false; /* We are playing an MP3 stream */ @@ -558,8 +559,9 @@ unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size) { (void)talk_buf; /* always grab the voice buffer for now */ - audio_hard_stop(); - + if (audio_is_initialized) + audio_hard_stop(); + if (!buffer_size) /* special case for talk_init() */ return NULL; @@ -3017,6 +3019,7 @@ void audio_init(void) dbg_cnt2us(0); #endif /* !SIMULATOR */ #endif /* DEBUG */ + audio_is_initialized = true; } #endif /* CONFIG_CODEC != SWCODEC */ |