[FFmpeg-cvslog] mp3dec: fix reading the Xing tag

Anton Khirnov git at videolan.org
Sun Jan 18 01:18:24 CET 2015


ffmpeg | branch: release/2.4 | Anton Khirnov <anton at khirnov.net> | Sat Oct 18 16:25:16 2014 +0200| [556a5090f2b0a20fd9998e1a327875f5b0c8d1d5] | committer: Vittorio Giovara

mp3dec: fix reading the Xing tag

The quality scale field is only supposed to be present if the fourth bit
is set. In practice, lame always sets it, but other tools might not.

CC:libav-stable at libav.org

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=556a5090f2b0a20fd9998e1a327875f5b0c8d1d5
---

 libavformat/mp3dec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index ce734b7..bf12fdb 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -36,6 +36,7 @@
 #define XING_FLAG_FRAMES 0x01
 #define XING_FLAG_SIZE   0x02
 #define XING_FLAG_TOC    0x04
+#define XING_FLAC_QSCALE 0x08
 
 #define XING_TOC_COUNT 100
 
@@ -168,7 +169,8 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st,
                                        st->time_base));
 
     /* VBR quality */
-    avio_rb32(s->pb);
+    if (v & XING_FLAC_QSCALE)
+        avio_rb32(s->pb);
 
     /* Encoder short version string */
     memset(version, 0, sizeof(version));



More information about the ffmpeg-cvslog mailing list