diff options
author | Michael Niedermayer <[email protected]> | 2015-12-09 21:45:07 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2015-12-13 02:15:36 +0100 |
commit | 07b43fb69afdcd091af7fd32228c2608fd4821cb (patch) | |
tree | 515227531445c82467fc79cfe0c316c6cffb8d23 | |
parent | e3f08d9359c35745baa03acffb53154944f43053 (diff) |
avformat/mov: Enable parser for mp3s by old HandBrake
Fixes Ticket5047
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 861f47ddf463926da2cba9e12665e7f004419f4b)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavformat/isom.h | 1 | ||||
-rw-r--r-- | libavformat/mov.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/isom.h b/libavformat/isom.h index 6e921c04a0..1f466f0286 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -184,6 +184,7 @@ typedef struct MOVContext { MOVTrackExt *trex_data; unsigned trex_count; int itunes_metadata; ///< metadata are itunes style + int handbrake_version; int chapter_track; int use_absolute_path; int ignore_editlist; diff --git a/libavformat/mov.c b/libavformat/mov.c index 735e956b62..4ce4e2dddd 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -419,6 +419,12 @@ retry: snprintf(key2, sizeof(key2), "%s-%s", key, language); av_dict_set(&c->fc->metadata, key2, str, 0); } + if (!strcmp(key, "encoder")) { + int major, minor, micro; + if (sscanf(str, "HandBrake %d.%d.%d", &major, &minor, µ) == 3) { + c->handbrake_version = 1000000*major + 1000*minor + micro; + } + } } av_log(c->fc, AV_LOG_TRACE, "lang \"%3s\" ", language); av_log(c->fc, AV_LOG_TRACE, "tag \"%s\" value \"%s\" atom \"%.4s\" %d %"PRId64"\n", @@ -4528,6 +4534,13 @@ static int mov_read_header(AVFormatContext *s) return err; } } + if (mov->handbrake_version && + mov->handbrake_version <= 1000000*0 + 1000*10 + 0 && // 0.10.0 + st->codec->codec_id == AV_CODEC_ID_MP3 + ) { + av_log(s, AV_LOG_VERBOSE, "Forcing full parsing for mp3 stream\n"); + st->need_parsing = AVSTREAM_PARSE_FULL; + } } if (mov->trex_data) { |