aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-14 04:41:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-14 04:42:08 +0100
commitf156dc54f8c285ec2f11cd9cc7e2e0d7c510cb04 (patch)
tree89abd66dd64b92ab3fec8af4e696be70d5b7fef9
parent685f50b374411fce2790d710f75c15410cb3cee7 (diff)
downloadffmpeg-f156dc54f8c285ec2f11cd9cc7e2e0d7c510cb04.tar.gz
mpegaudio_parser: fix off by 1 error
See: commit 29d8cd265a536063420afe78375b2176a9e1abc5 Author: Alexander Kojevnikov <alexander@kojevnikov.com> Date: Tue Feb 26 21:47:11 2013 -0800 mp3dec: Fix VBR bit rate parsing When parsing the Xing/Info tag, don't set the bit rate if it's an Info tag. When parsing the stream, don't override the bit rate if it's already set, otherwise calculate the mean bit rate from parsed frames. This way, the bit rate will be set correctly both for CBR and VBR streams. Signed-off-by: Alexander Kojevnikov <alexander@kojevnikov.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpegaudio_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c
index f592d5a0ae..408193671f 100644
--- a/libavcodec/mpegaudio_parser.c
+++ b/libavcodec/mpegaudio_parser.c
@@ -78,7 +78,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
s->header_count++;
s->frame_size = ret-4;
- if (s->header_count > 1) {
+ if (s->header_count > 0) {
avctx->sample_rate= sr;
avctx->channels = channels;
s1->duration = frame_size;