baseparse: Don't copy invalid DTS to the PTS

We were checking to make sure the buffer's DTS wouldn't be after its
PTS. However, the check would also trigger when DTS is NONE, which is
e.g. in the case of some broken cameras.

Fixes #470
This commit is contained in:
Vivia Nikolaidou 2019-11-28 13:09:45 +02:00
parent f590a861be
commit 1375c53f04

View file

@ -998,7 +998,8 @@ gst_base_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
if (must_approximate_pts) {
GST_BUFFER_PTS (buffer) = parse->priv->next_pts;
if (!must_approximate_dts
&& GST_BUFFER_DTS (buffer) > parse->priv->next_pts) {
&& GST_BUFFER_DTS (buffer) > parse->priv->next_pts
&& GST_CLOCK_TIME_IS_VALID (GST_BUFFER_DTS (buffer))) {
/* Can't present a frame before it's decoded: change the pts! This can
* happen, for example, when accumulating rounding errors from the
* buffer durations. Assume DTS is correct because only PTS is