From 495d0cef9b7ec8015796610d965f1a084ed12016 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 29 Jul 2011 17:29:53 +0200 Subject: [PATCH] Fix hwcodec sims --- apps/mpeg.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/apps/mpeg.c b/apps/mpeg.c index b79a0a106..2785107f2 100644 --- a/apps/mpeg.c +++ b/apps/mpeg.c @@ -149,13 +149,12 @@ static bool paused; /* playback is paused */ #ifdef SIMULATOR static char mpeg_stack[DEFAULT_STACK_SIZE]; static struct mp3entry taginfo; - #else /* !SIMULATOR */ static struct event_queue mpeg_queue SHAREDBSS_ATTR; static long mpeg_stack[(DEFAULT_STACK_SIZE + 0x1000)/sizeof(long)]; -static char* mpeg_audiobuf; -static long audiobuflen; +static char* mpeg_audiobuf; /* the audio buffer */ +static long audiobuflen; /* length of the audio buffer */ static int audiobuf_write; static int audiobuf_swapwrite; static long audiobuf_read; @@ -492,6 +491,18 @@ unsigned long mpeg_get_last_header(void) #endif /* !SIMULATOR */ } + +unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size) +{ + (void)talk_buf; /* always grab the voice buffer for now */ + talk_buffer_steal(); /* need to tell */ + + if (buffer_size) /* special case for talk_init() */ + return buffer_get_buffer(buffer_size); + return NULL; +} + + #ifndef SIMULATOR /* Send callback events to notify about removing old tracks. */ static void generate_unbuffer_events(void) @@ -557,16 +568,6 @@ void audio_set_buffer_margin(int setting) } #endif -unsigned char * audio_get_buffer(bool talk_buf, size_t *buffer_size) -{ - (void)talk_buf; /* always grab the voice buffer for now */ - talk_buffer_steal(); /* need to tell */ - - if (buffer_size) /* special case for talk_init() */ - return buffer_get_buffer(buffer_size); - return NULL; -} - void audio_get_debugdata(struct audio_debug *dbgdata) { dbgdata->audiobuflen = audiobuflen; @@ -2660,6 +2661,7 @@ void audio_set_recording_options(struct audio_recording_options *options) #endif /* SIMULATOR */ #endif /* CONFIG_CODEC == MAS3587F */ +#ifndef SIMULATOR static void audio_reset_buffer(void) { size_t bufsize; /* dont break strict-aliasing */ @@ -2672,6 +2674,7 @@ static void audio_reset_buffer(void) mpeg_audiobuf = buffer_get_buffer(&bufsize); audiobuflen = bufsize; } +#endif void audio_play(long offset) { -- 2.11.4.GIT