summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAlexander Kojevnikov <alexander@kojevnikov.com>2010-07-27 10:08:34 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-07-27 10:08:34 +0000
commit49d7ef282d9a78e4a6813ddabb78f99dac7f55a5 (patch)
tree79cda2c508b535e31786499c15465b7574128a09 /libavcodec
parent8a0f61c4fbb6d0467a35a26abe3e5bc5b1912be8 (diff)
Show correct bitrate for VBR MP3 files.
Patch by Alexander Kojevnikov, alexander kojevnikov com Originally committed as revision 24539 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpegaudiodec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 4f48c15e09..769be89913 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -2054,7 +2054,8 @@ static int decode_frame(AVCodecContext * avctx,
}
/* update codec info */
avctx->channels = s->nb_channels;
- avctx->bit_rate = s->bit_rate;
+ if (!avctx->bit_rate)
+ avctx->bit_rate = s->bit_rate;
avctx->sub_id = s->layer;
if(*data_size < 1152*avctx->channels*sizeof(OUT_INT))
@@ -2122,7 +2123,8 @@ static int decode_frame_adu(AVCodecContext * avctx,
/* update codec info */
avctx->sample_rate = s->sample_rate;
avctx->channels = s->nb_channels;
- avctx->bit_rate = s->bit_rate;
+ if (!avctx->bit_rate)
+ avctx->bit_rate = s->bit_rate;
avctx->sub_id = s->layer;
s->frame_size = len;