From d503b31b220b22ac946a7003d37ef8cf09ed8557 Mon Sep 17 00:00:00 2001 From: "ji.yong.seo" Date: Tue, 16 Jun 2015 14:38:02 +0900 Subject: [PATCH] Videos that contain cdis, get duration fail issue. (patch from latest ffmpeg) Change-Id: I5d9c9c3d0797e7d719019504052bac017b861518 --- libavformat/mov.c | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 libavformat/mov.c diff --git a/libavformat/mov.c b/libavformat/mov.c old mode 100644 new mode 100755 index 3734689..a17f907 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -812,6 +812,10 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_dlog(c->fc, "time scale = %i\n", c->time_scale); c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */ + // set the AVCodecContext duration because the duration of individual tracks + // may be inaccurate + if (c->time_scale > 0) + c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale); avio_rb32(pb); /* preferred scale */ avio_rb16(pb); /* preferred volume */ -- 2.7.4