gstreamer/subprojects/gst-integration-testsuites/testsuites/validate
Alicia Boya García 654ca283a7 qtdemux: Fix premature EOS when some files are played in push mode
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2771

This EOS branch exists so that if a seek with a stop is made, qtdemux
stops accepting bytes from the sink after the entire requested playback
range is demuxed, as otherwise we could keep download content that is
not being used.

This patch fixes two flaws that were present in that EOS check:

1) A comparison was made between track time and movie time without conversion.
This made the check trigger early in files with edit lists. This patch fixes
this by converting the track PTS to movie PTS (stream time) for the check.

2) To avoid sending a EOS prematurely when the segment stop is within a GOP and
B-frames are present, the check for EOS should only be done for keyframes. I
gather this was already the intention with the existing code, but because it
used `stream->on_keyframe` instead of the local variable `keyframe` the old
code was checking if the *previous* frame was a keyframe.

It's interesting to note that these two flaws in the old code mask each other
in most cases: the track PTS will have reached the movie end PTS, but EOS would
only be sent if the previous frame was a keyframe. A simple case where they
wouldn't mask each other, reproducing the bug, is a sequence of 3 frame GOPs
with structure I-B-P.

The following validateflow tests have been added to future-proof the
fix:

 * validate.test.mp4.qtdemux_ibpibp_non_frag_pull.default
 * validate.test.mp4.qtdemux_ibpibp_non_frag_push.default

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5114>
2023-08-03 20:22:51 +00:00
..
appsrc Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
aspectcropratio Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
baseparse test: update tests to include the new meta 2022-06-03 08:29:05 +00:00
clock_sync Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
dash matroska-demux: Properly handle early time-based segments 2023-06-23 08:55:47 +02:00
decryptor gst-integration-testsuites: Update cenc_audio_esds_property_overrides expected output file 2022-12-17 19:30:51 +02:00
flow Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
flvdemux Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
h264 test: update tests to include the new meta 2022-06-03 08:29:05 +00:00
h265parse h265parse: Don't override upstream framerate 2023-06-16 08:18:49 +00:00
interlace Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
matroska Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
mp4 qtdemux: Fix premature EOS when some files are played in push mode 2023-08-03 20:22:51 +00:00
mse qtdemux: Don't emit GstSegment correcting start time when in MSE mode 2023-02-18 10:38:30 +00:00
nle Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
playbin Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00
playbin3 oggdemux: vp8: Detect keyframe packets 2023-06-01 17:00:44 +00:00
rtp rtph264pay: Handle 'profile' field 2021-12-12 10:59:00 -03:00
scaletempo Import gst-integration-testsuites 2021-09-24 16:29:33 -03:00