From 7590cee744508e4d22403384dc230eefa154c0f6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 15 Nov 2010 12:49:05 +0100 Subject: [PATCH] pipeline: avoid using invalid clock times Be extra careful to not use invalid clock times but give a warning instead. This should make things work better with faulty clock implementations. --- gst/gstpipeline.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 8f5d381..7dd8ba8 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -343,7 +343,13 @@ pipeline_update_start_time (GstElement * element) GST_OBJECT_LOCK (element); /* store the current running time */ if (GST_ELEMENT_START_TIME (pipeline) != GST_CLOCK_TIME_NONE) { - GST_ELEMENT_START_TIME (pipeline) = now - element->base_time; + if (now != GST_CLOCK_TIME_NONE) + GST_ELEMENT_START_TIME (pipeline) = now - element->base_time; + else + GST_WARNING_OBJECT ("Clock %s returned invalid time, can't calculate " + "running_time when going to the PAUSED state", + GST_OBJECT_NAME (clock)); + /* we went to PAUSED, when going to PLAYING select clock and new * base_time */ pipeline->priv->update_clock = TRUE; -- 2.7.4