summaryrefslogtreecommitdiff
path: root/apps/codecs/mpa.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/mpa.c')
-rw-r--r--apps/codecs/mpa.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/apps/codecs/mpa.c b/apps/codecs/mpa.c
index 6fea80807f..3140091434 100644
--- a/apps/codecs/mpa.c
+++ b/apps/codecs/mpa.c
@@ -59,30 +59,29 @@ int mpeg_framesize[3] = {384, 1152, 1152};
59static void init_mad(void) 59static void init_mad(void)
60{ 60{
61 ci->memset(&stream, 0, sizeof(struct mad_stream)); 61 ci->memset(&stream, 0, sizeof(struct mad_stream));
62 ci->memset(&frame, 0, sizeof(struct mad_frame)); 62 ci->memset(&frame , 0, sizeof(struct mad_frame));
63 ci->memset(&synth, 0, sizeof(struct mad_synth)); 63 ci->memset(&synth , 0, sizeof(struct mad_synth));
64
65 ci->memset(&sbsample, 0, sizeof(sbsample));
66 64
67#ifdef MPA_SYNTH_ON_COP 65#ifdef MPA_SYNTH_ON_COP
68 frame.sbsample_prev = &sbsample_prev; 66 frame.sbsample_prev = &sbsample_prev;
69 ci->memset(&sbsample_prev, 0, sizeof(sbsample_prev)); 67 frame.sbsample = &sbsample;
70#else 68#else
71 frame.sbsample_prev = &sbsample; 69 frame.sbsample_prev = &sbsample;
70 frame.sbsample = &sbsample;
72#endif 71#endif
73 72
74 frame.sbsample=&sbsample; 73 /* We do this so libmad doesn't try to call codec_calloc(). This needs to
75 74 * be called before mad_stream_init(), mad_frame_inti() and
75 * mad_synth_init(). */
76 frame.overlap = &mad_frame_overlap;
77 stream.main_data = &mad_main_data;
78
79 /* Call mad initialization. Those will zero the arrays frame.overlap,
80 * frame.sbsample and frame.sbsample_prev. Therefore there is no need to
81 * zero them here. */
76 mad_stream_init(&stream); 82 mad_stream_init(&stream);
77 mad_frame_init(&frame); 83 mad_frame_init(&frame);
78 mad_synth_init(&synth); 84 mad_synth_init(&synth);
79
80 /* We do this so libmad doesn't try to call codec_calloc() */
81 ci->memset(mad_frame_overlap, 0, sizeof(mad_frame_overlap));
82 frame.overlap = &mad_frame_overlap;
83 stream.main_data = &mad_main_data;
84
85
86} 85}
87 86
88static int get_file_pos(int newtime) 87static int get_file_pos(int newtime)