diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-07-16 23:27:54 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-06 22:44:47 +0200 |
commit | a75a7feebd42fb1e8a4ce755de4ea2a307e19762 (patch) | |
tree | f7162b9bf1365b9a01cde52069c35100afa90632 | |
parent | 309fa24f361f1c9d357f8d152c3b78718d2f870d (diff) | |
download | ffmpeg-a75a7feebd42fb1e8a4ce755de4ea2a307e19762.tar.gz |
avformat/mov: Enable mp3 parsing if a packet needs it
Fixes Ticket5689
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 803c058a6f0c835c3094621d03d6e8c02565f28e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 33ee799a7e..7266fd09b0 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" @@ -5222,6 +5223,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; |