From 9b0d42ceecb3198399d7e05e3d5f080a7ca27ca9 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 2 Mar 2016 21:11:51 -0500 Subject: [PATCH] collectpads: Assume PTS is equal DTS if PTS is missing This is the best guess we can make if such a buffer reached the collect pad. This is uncommon, we do expect parsers to have tried and fixed that if possible (or needed). https://bugzilla.gnome.org/show_bug.cgi?id=762207 --- libs/gst/base/gstcollectpads.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c index dc18222..7358cb3 100644 --- a/libs/gst/base/gstcollectpads.c +++ b/libs/gst/base/gstcollectpads.c @@ -515,6 +515,12 @@ gst_collect_pads_clip_running_time (GstCollectPads * pads, time = GST_BUFFER_PTS (buf); + /* If PTS is not set, the best guess we can make is to assume that both + * PTS and DTS are the same. If it was possible, parsers should have fixed + * it already as explained in https://bugzilla.gnome.org/show_bug.cgi?id=659489 */ + if (!GST_CLOCK_TIME_IS_VALID (time)) + time = GST_BUFFER_DTS (buf); + if (GST_CLOCK_TIME_IS_VALID (time)) { time = gst_segment_to_running_time (&cdata->segment, GST_FORMAT_TIME, time); -- 2.7.4