qtdemux: Don't use tfdt for parsing subsequent trun boxes
authorSebastian Dröge <sebastian@centricular.com>
Thu, 12 May 2022 14:11:38 +0000 (17:11 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 13 May 2022 04:19:36 +0000 (04:19 +0000)
commit1223324246d83270faf24a8862ad6fb1244ca950
tree8fe67f7aacc9c024bcc27e182fe378d73e396755
parent858520932c25d80a46a6eab58572bff3545d253f
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>
subprojects/gst-plugins-good/gst/isomp4/qtdemux.c