From 9d0e2e7252398c660c33c79256333f76a6d97dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 8 Jul 2010 07:48:07 +0200 Subject: [PATCH] pipeline: If the currently used clock gets lost update it the next time when going from PAUSED to playing Fixes bug #623806. --- gst/gstpipeline.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index 73c8f99169..8f5d381b1d 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -401,7 +401,7 @@ gst_pipeline_change_state (GstElement * element, GstStateChange transition) /* running time changed, either with a PAUSED or a flush, we need to check * if there is a new clock & update the base time */ - if (last_start_time != start_time) { + if (update_clock || last_start_time != start_time) { GST_DEBUG_OBJECT (pipeline, "Need to update start_time"); /* when going to PLAYING, select a clock when needed. If we just got @@ -560,6 +560,20 @@ gst_pipeline_handle_message (GstBin * bin, GstMessage * message) break; } + case GST_MESSAGE_CLOCK_LOST: + { + GstClock *clock; + + gst_message_parse_clock_lost (message, &clock); + + GST_OBJECT_LOCK (bin); + if (clock == GST_ELEMENT_CAST (bin)->clock) { + GST_DEBUG_OBJECT (bin, "Used clock '%s' got lost", + GST_OBJECT_NAME (clock)); + pipeline->priv->update_clock = TRUE; + } + GST_OBJECT_UNLOCK (bin); + } default: break; }