qtdemux: Determine EOS based on the stream segment

Depending on the stream segment might vary (because of edts for example)
leading to EOS being sent at the wrong time (too early for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5724>
This commit is contained in:
Thibault Saunier 2023-11-28 11:27:45 -03:00 committed by Sebastian Dröge
parent 36529475ae
commit 8295b2ae5c

View file

@ -8453,9 +8453,9 @@ gst_qtdemux_process_adapter (GstQTDemux * demux, gboolean force)
keyframe = QTSAMPLE_KEYFRAME (stream, sample); keyframe = QTSAMPLE_KEYFRAME (stream, sample);
/* check for segment end */ /* check for segment end */
if (G_UNLIKELY (demux->segment.stop != -1 if (G_UNLIKELY (stream->segment.stop != -1
&& demux->segment.stop <= stream_pts && keyframe) && stream->segment.stop <= stream_pts && keyframe)
&& !(demux->upstream_format_is_time && demux->segment.rate < 0)) { && !(demux->upstream_format_is_time && stream->segment.rate < 0)) {
GST_DEBUG_OBJECT (demux, "we reached the end of our segment."); GST_DEBUG_OBJECT (demux, "we reached the end of our segment.");
stream->time_position = GST_CLOCK_TIME_NONE; /* this means EOS */ stream->time_position = GST_CLOCK_TIME_NONE; /* this means EOS */