diff options
Diffstat (limited to 'apps/plugins/mpegplayer')
-rw-r--r-- | apps/plugins/mpegplayer/audio_thread.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/apps/plugins/mpegplayer/audio_thread.c b/apps/plugins/mpegplayer/audio_thread.c index d626df6681..84f0229000 100644 --- a/apps/plugins/mpegplayer/audio_thread.c +++ b/apps/plugins/mpegplayer/audio_thread.c | |||
@@ -225,20 +225,22 @@ static int audio_buffer(struct stream *str, enum stream_parse_mode type) | |||
225 | /* Initialise libmad */ | 225 | /* Initialise libmad */ |
226 | static void init_mad(void) | 226 | static void init_mad(void) |
227 | { | 227 | { |
228 | /*init the sbsample buffer*/ | 228 | /* init the sbsample buffer */ |
229 | frame.sbsample = &sbsample; | ||
230 | frame.sbsample_prev = &sbsample; | 229 | frame.sbsample_prev = &sbsample; |
231 | 230 | frame.sbsample = &sbsample; | |
231 | |||
232 | /* We do this so libmad doesn't try to call codec_calloc(). This needs to | ||
233 | * be called before mad_stream_init(), mad_frame_inti() and | ||
234 | * mad_synth_init(). */ | ||
235 | frame.overlap = &mad_frame_overlap; | ||
236 | stream.main_data = &mad_main_data; | ||
237 | |||
238 | /* Call mad initialization. Those will zero the arrays frame.overlap, | ||
239 | * frame.sbsample and frame.sbsample_prev. Therefore there is no need to | ||
240 | * zero them here. */ | ||
232 | mad_stream_init(&stream); | 241 | mad_stream_init(&stream); |
233 | mad_frame_init(&frame); | 242 | mad_frame_init(&frame); |
234 | mad_synth_init(&synth); | 243 | mad_synth_init(&synth); |
235 | |||
236 | /* We do this so libmad doesn't try to call codec_calloc() */ | ||
237 | rb->memset(mad_frame_overlap, 0, sizeof(mad_frame_overlap)); | ||
238 | frame.overlap = (void *)mad_frame_overlap; | ||
239 | |||
240 | rb->memset(mad_main_data, 0, sizeof(mad_main_data)); | ||
241 | stream.main_data = &mad_main_data; | ||
242 | } | 244 | } |
243 | 245 | ||
244 | /* Sync audio stream to a particular frame - see main decoder loop for | 246 | /* Sync audio stream to a particular frame - see main decoder loop for |