Skip to content

Commit 07b43fb

Browse files
committed
avformat/mov: Enable parser for mp3s by old HandBrake
Fixes Ticket5047 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 861f47d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
1 parent e3f08d9 commit 07b43fb

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

libavformat/isom.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ typedef struct MOVContext {
184184
MOVTrackExt *trex_data;
185185
unsigned trex_count;
186186
int itunes_metadata; ///< metadata are itunes style
187+
int handbrake_version;
187188
int chapter_track;
188189
int use_absolute_path;
189190
int ignore_editlist;

libavformat/mov.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
419419
snprintf(key2, sizeof(key2), "%s-%s", key, language);
420420
av_dict_set(&c->fc->metadata, key2, str, 0);
421421
}
422+
if (!strcmp(key, "encoder")) {
423+
int major, minor, micro;
424+
if (sscanf(str, "HandBrake %d.%d.%d", &major, &minor, &micro) == 3) {
425+
c->handbrake_version = 1000000*major + 1000*minor + micro;
426+
}
427+
}
422428
}
423429
av_log(c->fc, AV_LOG_TRACE, "lang \"%3s\" ", language);
424430
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)
45284534
return err;
45294535
}
45304536
}
4537+
if (mov->handbrake_version &&
4538+
mov->handbrake_version <= 1000000*0 + 1000*10 + 0 && // 0.10.0
4539+
st->codec->codec_id == AV_CODEC_ID_MP3
4540+
) {
4541+
av_log(s, AV_LOG_VERBOSE, "Forcing full parsing for mp3 stream\n");
4542+
st->need_parsing = AVSTREAM_PARSE_FULL;
4543+
}
45314544
}
45324545

45334546
if (mov->trex_data) {

0 commit comments

Comments
 (0)