X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=mp3dec_filter.c;h=7731a379cfe6028559829cdcff9c29e4f541b983;hp=82f014189d3ccb8ece45652ec17fa80c9a3ee6b6;hb=de8f6f12fdd4e740d10a167a839e37e79257e955;hpb=23615455a3ee7cca4b39c4e1c414ef943e319986 diff --git a/mp3dec_filter.c b/mp3dec_filter.c index 82f01418..7731a379 100644 --- a/mp3dec_filter.c +++ b/mp3dec_filter.c @@ -181,14 +181,13 @@ next_frame: } mad_synth_frame(&pmd->synth, &pmd->frame); pmd->flags |= MP3DEC_FLAG_DECODE_STARTED; - - outbuffer = para_malloc(pmd->synth.pcm.length * 4); + outbuffer = para_malloc(pmd->synth.pcm.length * 2 * pmd->channels); loaded = 0; for (i = 0; i < pmd->synth.pcm.length; i++) { int sample = MAD_TO_SHORT(pmd->synth.pcm.samples[0][i]); write_int16_host_endian(outbuffer + loaded, sample); loaded += 2; - if (MAD_NCHANNELS(&pmd->frame.header) == 2) { /* stereo */ + if (pmd->channels == 2) { /* stereo */ sample = MAD_TO_SHORT(pmd->synth.pcm.samples[1][i]); write_int16_host_endian(outbuffer + loaded, sample); loaded += 2;