mpegpsdemux: Ignore DTS if PTS < DTS

It's possibly timestamp rollover case. But PTS < DTS is already
invalid case anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3834>
This commit is contained in:
Seungha Yang 2022-12-30 00:49:27 +09:00 committed by Tim-Philipp Müller
parent 1f45b0e7e3
commit 19238bdc6f

View file

@ -712,6 +712,16 @@ gst_ps_demux_send_data (GstPsDemux * demux, GstPsStream * stream,
gst_ps_demux_send_segment (demux, stream, pts);
/* Ignores DTS if PTS < DTS. Maybe additional sanity checking is possible
* by comparing 33bits timestap rollover case, but PTS < DTS is already
* invalid case */
if (GST_CLOCK_TIME_IS_VALID (pts) && GST_CLOCK_TIME_IS_VALID (dts) &&
dts > pts) {
GST_WARNING_OBJECT (demux, "PTS (%" GST_TIME_FORMAT ") < DTS (%"
GST_TIME_FORMAT ")", GST_TIME_ARGS (pts), GST_TIME_ARGS (dts));
dts = GST_CLOCK_TIME_NONE;
}
/* OK, sent new segment now prepare the buffer for sending */
GST_BUFFER_PTS (buf) = pts;
GST_BUFFER_DTS (buf) = dts;