mp3dec: Fix VBR bit rate parsing
authorAlexander Kojevnikov <alexander@kojevnikov.com>
Wed, 27 Feb 2013 05:47:11 +0000 (21:47 -0800)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 5 Mar 2013 12:06:01 +0000 (13:06 +0100)
commit29d8cd265a536063420afe78375b2176a9e1abc5
tree89d1f5303bf7e7654e3fc8ebe8de1f9cadd1742c
parentd2b0b839b9e39ec98cb3f36dd692448f93a8b6d7
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>
libavcodec/mpegaudio_parser.c
libavformat/mp3dec.c
tests/ref/lavf-fate/mp3