summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2021-05-29 14:27:34 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2021-06-02 10:46:04 +0530
commit071930de724166bfb90fc6d368c748771188fd94 (patch)
tree23742d9de807a3ebc92b1ff61c5694a9b877f6d4 /libavformat/mov.c
parent127c40c9ca90dfe03cde0181f1e6654813a4b2b7 (diff)
avformat/mov: add option to use tfdt for fragment timestamps.
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index c088c9f515..6c99a67ff5 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4803,7 +4803,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
dts = frag_stream_info->first_tfra_pts;
av_log(c->fc, AV_LOG_DEBUG, "found mfra time %"PRId64
", using it for dts\n", pts);
- } else if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE) {
+ } else if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE && !c->use_tfdt) {
// FIXME: sidx earliest_presentation_time is *PTS*, s.b.
// pts = frag_stream_info->sidx_pts;
dts = frag_stream_info->sidx_pts - sc->time_offset;
@@ -8169,6 +8169,8 @@ static const AVOption mov_options[] = {
FLAGS, "use_mfra_for" },
{"pts", "pts", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_MFRA_PTS}, 0, 0,
FLAGS, "use_mfra_for" },
+ {"use_tfdt", "use tfdt for fragment timestamps", OFFSET(use_tfdt), AV_OPT_TYPE_BOOL, {.i64 = 0},
+ 0, 1, FLAGS},
{ "export_all", "Export unrecognized metadata entries", OFFSET(export_all),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = FLAGS },
{ "export_xmp", "Export full XMP metadata", OFFSET(export_xmp),