From 1223324246d83270faf24a8862ad6fb1244ca950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 12 May 2022 17:11:38 +0300 Subject: [PATCH] qtdemux: Don't use tfdt for parsing subsequent trun boxes The timestamp in the tfdt refers to the first trun box and if there are multiple trun boxes then the distance between the first timestamps will grow. At some point this distance reaches a threshold and triggers the resetting of the first sample's timestamp of this trun box to be reset to the tfdt. This threshold is implemented for files where there is a jump in the timeline between fragments and where this can be detected via a jump between the end timestamp of the previous fragment and the tfdt of the next. This behaviour is preserved. Part-of: --- subprojects/gst-plugins-good/gst/isomp4/qtdemux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c b/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c index a67e5d3494..2535f8177f 100644 --- a/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c +++ b/subprojects/gst-plugins-good/gst/isomp4/qtdemux.c @@ -4154,6 +4154,8 @@ qtdemux_parse_moof (GstQTDemux * qtdemux, const guint8 * buffer, guint length, /* iterate all siblings */ trun_node = qtdemux_tree_get_sibling_by_type_full (trun_node, FOURCC_trun, &trun_data); + /* don't use tfdt for subsequent trun as it only refers to the first */ + tfdt_node = NULL; } uuid_node = qtdemux_tree_get_child_by_type (traf_node, FOURCC_uuid);