OSDN Git Service

correctly compute out_size and samples number
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 26 Apr 2008 13:03:41 +0000 (13:03 +0000)
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>
Sat, 26 Apr 2008 13:03:41 +0000 (13:03 +0000)
Originally committed as revision 12985 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/mpegaudiodec.c

index 1691a77..df28033 100644 (file)
@@ -2596,11 +2596,10 @@ static int decode_frame_mp3on4(AVCodecContext * avctx,
         }
 
         ff_mpegaudio_decode_header(m, header);
-        mp_decode_frame(m, decoded_buf, start, fsize);
+        out_size += mp_decode_frame(m, decoded_buf, start, fsize);
 
-        n = MPA_FRAME_SIZE * m->nb_channels;
-        out_size += n * sizeof(OUT_INT);
         if(s->frames > 1) {
+            n = m->avctx->frame_size*m->nb_channels;
             /* interleave output data */
             bp = out_samples + coff[fr];
             if(m->nb_channels == 1) {