summaryrefslogtreecommitdiff
path: root/apps/mpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/mpeg.c')
-rw-r--r--apps/mpeg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/mpeg.c b/apps/mpeg.c
index b7db602120..9048226133 100644
--- a/apps/mpeg.c
+++ b/apps/mpeg.c
@@ -142,6 +142,7 @@ static bool checked_for_cuesheet = false;
142 142
143static const char mpeg_thread_name[] = "mpeg"; 143static const char mpeg_thread_name[] = "mpeg";
144static unsigned int audio_thread_id; 144static unsigned int audio_thread_id;
145static bool audio_is_initialized;
145static unsigned int mpeg_errno; 146static unsigned int mpeg_errno;
146 147
147static bool playing = false; /* We are playing an MP3 stream */ 148static 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)
558{ 559{
559 (void)talk_buf; /* always grab the voice buffer for now */ 560 (void)talk_buf; /* always grab the voice buffer for now */
560 561
561 audio_hard_stop(); 562 if (audio_is_initialized)
562 563 audio_hard_stop();
564
563 if (!buffer_size) /* special case for talk_init() */ 565 if (!buffer_size) /* special case for talk_init() */
564 return NULL; 566 return NULL;
565 567
@@ -3017,6 +3019,7 @@ void audio_init(void)
3017 dbg_cnt2us(0); 3019 dbg_cnt2us(0);
3018#endif /* !SIMULATOR */ 3020#endif /* !SIMULATOR */
3019#endif /* DEBUG */ 3021#endif /* DEBUG */
3022 audio_is_initialized = true;
3020} 3023}
3021 3024
3022#endif /* CONFIG_CODEC != SWCODEC */ 3025#endif /* CONFIG_CODEC != SWCODEC */