summaryrefslogtreecommitdiff
path: root/apps/codecs/wma.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/wma.c')
-rw-r--r--apps/codecs/wma.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/apps/codecs/wma.c b/apps/codecs/wma.c
index ed413e8c32..4c535689d8 100644
--- a/apps/codecs/wma.c
+++ b/apps/codecs/wma.c
@@ -25,12 +25,6 @@
25 25
26CODEC_HEADER 26CODEC_HEADER
27 27
28/* The output buffer containing the decoded samples (channels 0 and 1)
29 BLOCK_MAX_SIZE is 2048 (samples) and MAX_CHANNELS is 2.
30 */
31
32static uint32_t decoded[BLOCK_MAX_SIZE * MAX_CHANNELS] IBSS_ATTR;
33
34/* NOTE: WMADecodeContext is 120152 bytes (on x86) */ 28/* NOTE: WMADecodeContext is 120152 bytes (on x86) */
35static WMADecodeContext wmadec; 29static WMADecodeContext wmadec;
36 30
@@ -100,7 +94,7 @@ restart_track:
100 resume_offset = 0; 94 resume_offset = 0;
101 ci->configure(DSP_SWITCH_FREQUENCY, wfx.rate); 95 ci->configure(DSP_SWITCH_FREQUENCY, wfx.rate);
102 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ? 96 ci->configure(DSP_SET_STEREO_MODE, wfx.channels == 1 ?
103 STEREO_MONO : STEREO_INTERLEAVED); 97 STEREO_MONO : STEREO_NONINTERLEAVED);
104 codec_set_replaygain(ci->id3); 98 codec_set_replaygain(ci->id3);
105 99
106 /* The main decoding loop */ 100 /* The main decoding loop */
@@ -157,7 +151,6 @@ new_packet:
157 for (i=0; i < wmadec.nb_frames; i++) 151 for (i=0; i < wmadec.nb_frames; i++)
158 { 152 {
159 wmares = wma_decode_superframe_frame(&wmadec, 153 wmares = wma_decode_superframe_frame(&wmadec,
160 decoded,
161 audiobuf, audiobufsize); 154 audiobuf, audiobufsize);
162 155
163 ci->yield (); 156 ci->yield ();
@@ -173,7 +166,7 @@ new_packet:
173 goto new_packet; 166 goto new_packet;
174 } 167 }
175 } else if (wmares > 0) { 168 } else if (wmares > 0) {
176 ci->pcmbuf_insert(decoded, NULL, wmares); 169 ci->pcmbuf_insert((*wmadec.frame_out)[0], (*wmadec.frame_out)[1], wmares);
177 elapsedtime += (wmares*10)/(wfx.rate/100); 170 elapsedtime += (wmares*10)/(wfx.rate/100);
178 ci->set_elapsed(elapsedtime); 171 ci->set_elapsed(elapsedtime);
179 } 172 }