Videos that contain cdis, get duration fail issue. (patch from latest ffmpeg) 76/41476/2
authorji.yong.seo <ji.yong.seo@samsung.com>
Tue, 16 Jun 2015 05:38:02 +0000 (14:38 +0900)
committerji.yong.seo <ji.yong.seo@samsung.com>
Wed, 17 Jun 2015 05:40:13 +0000 (14:40 +0900)
Change-Id: I5d9c9c3d0797e7d719019504052bac017b861518

libavformat/mov.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 3734689..a17f907
@@ -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 */