[FFmpeg-devel] [PATCH V1] lavf/mov: fix fMP4 tfdt box lead to dts reset issue
Jun Zhao
mypopydev at gmail.com
Tue Aug 13 13:29:00 EEST 2019
From: Jun Zhao <barryjzhao at tencent.com>
In fMP4 format, traf maybe have zero or more trun box, in this case,
we just used tfdt as dts once. The sample layout like this:
[moof] size=8+1392
[mfhd] size=12+4
sequence number = 29
[traf] size=8+1368
[tfhd] size=12+16, flags=20038
track ID = 1
default sample duration = 512
default sample size = 40720
default sample flags = 0
[tfdt] size=12+8, version=1
base media decode time = 1873920
[trun] size=12+452, version=1, flags=e01
sample count = 37
data offset = 1408
[trun] size=12+452, version=1, flags=e01
sample count = 37
data offset = 292973
[trun] size=12+380, version=1, flags=e01
sample count = 31
data offset = 586457
Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
libavformat/mov.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 24de542..d47d491 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4762,6 +4762,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
dts = frag_stream_info->tfdt_dts - sc->time_offset;
av_log(c->fc, AV_LOG_DEBUG, "found tfdt time %"PRId64
", using it for dts\n", dts);
+ frag_stream_info->tfdt_dts = AV_NOPTS_VALUE;
} else {
dts = sc->track_end - sc->time_offset;
av_log(c->fc, AV_LOG_DEBUG, "found track end time %"PRId64
--
1.7.1
More information about the ffmpeg-devel
mailing list