From a8ae32df6d449b15e4b07099c339a4e545046323 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 28 Oct 2013 19:49:52 -0300 Subject: [PATCH] pad-monitor: Do not concider TIME_NONE as 0 for serialized events In case we have serialized events right after a buffer that had no timestamp set we concider that last timestamp was 0, but we can actually not concider the timestamp at all in that case as it is only "meaningless value". --- validate/gst/validate/gst-validate-pad-monitor.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 41da298920..cfb4266da4 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -489,7 +489,7 @@ gst_validate_pad_monitor_check_late_serialized_events (GstValidatePadMonitor * GST_DEBUG_OBJECT (monitor->pad, "Event #%d (%s) ts: %" GST_TIME_FORMAT, i, GST_EVENT_TYPE_NAME (data->event), GST_TIME_ARGS (data->timestamp)); - if (data->timestamp < ts) { + if (GST_CLOCK_TIME_IS_VALID (data->timestamp) && data->timestamp < ts) { GST_VALIDATE_REPORT (monitor, SERIALIZED_EVENT_WASNT_PUSHED_IN_TIME, "Serialized event %" GST_PTR_FORMAT " wasn't pushed before expected " "timestamp %" GST_TIME_FORMAT " on pad %s:%s", data->event, @@ -1483,14 +1483,12 @@ gst_validate_pad_monitor_sink_event_func (GstPad * pad, GstObject * parent, GST_VALIDATE_MONITOR_LOCK (pad_monitor); if (gst_validate_pad_monitor_event_is_tracked (pad_monitor, event)) { - GstClockTime last_ts; + GstClockTime last_ts = GST_CLOCK_TIME_NONE; if (GST_CLOCK_TIME_IS_VALID (pad_monitor->current_timestamp)) { last_ts = pad_monitor->current_timestamp; if (GST_CLOCK_TIME_IS_VALID (pad_monitor->current_duration)) { last_ts += pad_monitor->current_duration; } - } else { - last_ts = 0; } gst_validate_pad_monitor_otherpad_add_pending_serialized_event (pad_monitor, event, last_ts);