mpegpsdemux: avoid early EOS

In a case of a scr different from 0, after a seek,
the src_segment.stop has been updated with the duration
not including the base_time (scr). The segment position
needs to be tested upon segment.stop + base_time (scr)
to check for an EOS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2048>
This commit is contained in:
Stéphane Cerveau 2021-03-01 16:23:09 +01:00
parent 32fa99d3e0
commit 96467f581e

View file

@ -2980,9 +2980,11 @@ gst_ps_demux_loop (GstPad * pad)
offset += size; offset += size;
gst_segment_set_position (&demux->sink_segment, GST_FORMAT_BYTES, offset); gst_segment_set_position (&demux->sink_segment, GST_FORMAT_BYTES, offset);
/* check EOS condition */ /* check EOS condition */
/* FIXME: The src_segment.stop is not including the SCR after seek(set) */
if ((demux->sink_segment.position >= demux->sink_segment.stop) || if ((demux->sink_segment.position >= demux->sink_segment.stop) ||
(demux->src_segment.stop != (guint64) - 1 && (demux->src_segment.stop != (guint64) - 1 &&
demux->src_segment.position >= demux->src_segment.stop)) { demux->src_segment.position >=
demux->src_segment.stop + demux->base_time)) {
GST_DEBUG_OBJECT (demux, GST_DEBUG_OBJECT (demux,
"forward mode using segment reached end of " "segment pos %" "forward mode using segment reached end of " "segment pos %"
GST_TIME_FORMAT " stop %" GST_TIME_FORMAT " pos in bytes %" GST_TIME_FORMAT " stop %" GST_TIME_FORMAT " pos in bytes %"