Permalink
Browse files

avformat/mov: Enable parser for mp3s by old HandBrake

Fixes Ticket5047

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information...
Michael Niedermayer
Michael Niedermayer committed Dec 9, 2015
1 parent 537e901 commit 861f47ddf463926da2cba9e12665e7f004419f4b
Showing with 14 additions and 0 deletions.
  1. +1 −0 libavformat/isom.h
  2. +13 −0 libavformat/mov.c
@@ -188,6 +188,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;
@@ -447,6 +447,12 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
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, &micro) == 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",
@@ -4693,6 +4699,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) {

0 comments on commit 861f47d

Please sign in to comment.