[FFmpeg-cvslog] r12996 - trunk/libavcodec/mpegaudiodec.c
bcoudurier
subversion
Sat Apr 26 16:33:10 CEST 2008
Author: bcoudurier
Date: Sat Apr 26 16:33:09 2008
New Revision: 12996
Log:
simplify: merge loops
Modified:
trunk/libavcodec/mpegaudiodec.c
Modified: trunk/libavcodec/mpegaudiodec.c
==============================================================================
--- trunk/libavcodec/mpegaudiodec.c (original)
+++ trunk/libavcodec/mpegaudiodec.c Sat Apr 26 16:33:09 2008
@@ -2572,7 +2572,7 @@ static int decode_frame_mp3on4(AVCodecCo
OUT_INT decoded_buf[MPA_FRAME_SIZE * MPA_MAX_CHANNELS];
OUT_INT *outptr, *bp;
int fsize;
- int fr, i, j, n;
+ int fr, j, n;
len = buf_size;
@@ -2584,6 +2584,8 @@ static int decode_frame_mp3on4(AVCodecCo
// If only one decoder interleave is not needed
outptr = s->frames == 1 ? out_samples : decoded_buf;
+ avctx->bit_rate = 0;
+
for (fr = 0; fr < s->frames; fr++) {
fsize = AV_RB16(buf) >> 4;
fsize = FFMIN3(fsize, len, MPA_MAX_CODED_FRAME_SIZE);
@@ -2619,13 +2621,11 @@ static int decode_frame_mp3on4(AVCodecCo
}
}
}
+ avctx->bit_rate += m->bit_rate;
}
/* update codec info */
avctx->sample_rate = s->mp3decctx[0]->sample_rate;
- avctx->bit_rate = 0;
- for (i = 0; i < s->frames; i++)
- avctx->bit_rate += s->mp3decctx[i]->bit_rate;
*data_size = out_size;
return buf_size;
More information about the ffmpeg-cvslog
mailing list