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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2409>
This commit is contained in:
Sebastian Dröge 2022-05-12 17:11:38 +03:00 committed by GStreamer Marge Bot
parent 858520932c
commit 1223324246

View file

@ -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);