[FFmpeg-cvslog] avformat/mov: Enable mp3 parsing if a packet needs it

Michael Niedermayer git at videolan.org
Sat Aug 6 23:47:04 EEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Jul 16 23:27:54 2016 +0200| [803c058a6f0c835c3094621d03d6e8c02565f28e] | committer: Michael Niedermayer

avformat/mov: Enable mp3 parsing if a packet needs it

Fixes Ticket5689

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/mov.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7c8f784..f4c35d7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -43,6 +43,7 @@
 #include "libavutil/sha.h"
 #include "libavutil/timecode.h"
 #include "libavcodec/ac3tab.h"
+#include "libavcodec/mpegaudiodecheader.h"
 #include "avformat.h"
 #include "internal.h"
 #include "avio_internal.h"
@@ -5340,6 +5341,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
                 return ret;
         }
 #endif
+        if (st->codecpar->codec_id == AV_CODEC_ID_MP3 && !st->need_parsing && pkt->size > 4) {
+            if (ff_mpa_check_header(AV_RB32(pkt->data)) < 0)
+                st->need_parsing = AVSTREAM_PARSE_FULL;
+        }
     }
 
     pkt->stream_index = sc->ffindex;



More information about the ffmpeg-cvslog mailing list