diff options
| author | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-06-27 18:11:07 +0000 |
|---|---|---|
| committer | Andree Buschmann <AndreeBuschmann@t-online.de> | 2010-06-27 18:11:07 +0000 |
| commit | 4c026f0c7f5ca6d02bf010fabe5123b9b39ddf47 (patch) | |
| tree | 18c1d4ae3392fb904dd981d0bcd110a46a1bbd35 /apps/codecs/mpa.c | |
| parent | 9e86287946517e06893f4950d45d60056c00d9e7 (diff) | |
| download | rockbox-4c026f0c7f5ca6d02bf010fabe5123b9b39ddf47.zip rockbox-4c026f0c7f5ca6d02bf010fabe5123b9b39ddf47.tar.gz rockbox-4c026f0c7f5ca6d02bf010fabe5123b9b39ddf47.tar.bz2 rockbox-4c026f0c7f5ca6d02bf010fabe5123b9b39ddf47.tar.xz | |
Comment unused code in libmad. Clean up initialization and memset'ing of decoder arrays.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27159 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/mpa.c')
| -rw-r--r-- | apps/codecs/mpa.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c index 6fea808..3140091 100644 --- a/apps/codecs/mpa.c +++ b/apps/codecs/mpa.c @@ -59,30 +59,29 @@ int mpeg_framesize[3] = {384, 1152, 1152}; static void init_mad(void) { ci->memset(&stream, 0, sizeof(struct mad_stream)); - ci->memset(&frame, 0, sizeof(struct mad_frame)); - ci->memset(&synth, 0, sizeof(struct mad_synth)); - - ci->memset(&sbsample, 0, sizeof(sbsample)); + ci->memset(&frame , 0, sizeof(struct mad_frame)); + ci->memset(&synth , 0, sizeof(struct mad_synth)); #ifdef MPA_SYNTH_ON_COP frame.sbsample_prev = &sbsample_prev; - ci->memset(&sbsample_prev, 0, sizeof(sbsample_prev)); + frame.sbsample = &sbsample; #else frame.sbsample_prev = &sbsample; + frame.sbsample = &sbsample; #endif - frame.sbsample=&sbsample; - + /* We do this so libmad doesn't try to call codec_calloc(). This needs to + * be called before mad_stream_init(), mad_frame_inti() and + * mad_synth_init(). */ + frame.overlap = &mad_frame_overlap; + stream.main_data = &mad_main_data; + + /* Call mad initialization. Those will zero the arrays frame.overlap, + * frame.sbsample and frame.sbsample_prev. Therefore there is no need to + * zero them here. */ mad_stream_init(&stream); mad_frame_init(&frame); mad_synth_init(&synth); - - /* We do this so libmad doesn't try to call codec_calloc() */ - ci->memset(mad_frame_overlap, 0, sizeof(mad_frame_overlap)); - frame.overlap = &mad_frame_overlap; - stream.main_data = &mad_main_data; - - } static int get_file_pos(int newtime) |