Skip to content

Commit 861f47d

Browse files
committed
avformat/mov: Enable parser for mp3s by old HandBrake
Fixes Ticket5047 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent 537e901 commit 861f47d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libavformat/isom.h

+1
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ typedef struct MOVContext {
188188
MOVTrackExt *trex_data;
189189
unsigned trex_count;
190190
int itunes_metadata; ///< metadata are itunes style
191+
int handbrake_version;
191192
int chapter_track;
192193
int use_absolute_path;
193194
int ignore_editlist;

libavformat/mov.c

+13
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,12 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
447447
snprintf(key2, sizeof(key2), "%s-%s", key, language);
448448
av_dict_set(&c->fc->metadata, key2, str, 0);
449449
}
450+
if (!strcmp(key, "encoder")) {
451+
int major, minor, micro;
452+
if (sscanf(str, "HandBrake %d.%d.%d", &major, &minor, &micro) == 3) {
453+
c->handbrake_version = 1000000*major + 1000*minor + micro;
454+
}
455+
}
450456
}
451457
av_log(c->fc, AV_LOG_TRACE, "lang \"%3s\" ", language);
452458
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)
46934699
return err;
46944700
}
46954701
}
4702+
if (mov->handbrake_version &&
4703+
mov->handbrake_version <= 1000000*0 + 1000*10 + 0 && // 0.10.0
4704+
st->codec->codec_id == AV_CODEC_ID_MP3
4705+
) {
4706+
av_log(s, AV_LOG_VERBOSE, "Forcing full parsing for mp3 stream\n");
4707+
st->need_parsing = AVSTREAM_PARSE_FULL;
4708+
}
46964709
}
46974710

46984711
if (mov->trex_data) {

0 commit comments

Comments
 (0)