splitmuxsink: Handle frame reordering due to B frames better
authorSebastian Dröge <sebastian@centricular.com>
Thu, 16 Sep 2021 16:36:27 +0000 (19:36 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 5 Oct 2021 12:35:19 +0000 (12:35 +0000)
commitae8ceb801cc0548be9926bdbb9a7f36c20195e56
tree3d7230b48274a41fd2c90528b014b614e823d1ba
parentf83ed50c20da2d3f960c36b0e058bb94ff4ae335
splitmuxsink: Handle frame reordering due to B frames better

Instead of assuming that the PTS of a keyframe is the lowest PTS of a
GOP, wait until the DTS has passed this PTS and take the minimum PTS up
to that point. That way the minimum PTS of a GOP can be determined, at
least for closed GOP streams. Open GOP streams still can't be handled
properly.

By knowing the minimum PTS of each GOP, keyframes can be requested at
the correct time relative to the GOP (and thus fragment) start and
fragment overflow calculations can calculate the correct durations of
the GOPs.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1005>
subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.c
subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsink.h