Don't forward LATENCY event when not ready
authorWim Taymans <wim.taymans@collabora.co.uk>
Mon, 23 Feb 2009 09:53:17 +0000 (10:53 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Mon, 23 Feb 2009 09:53:17 +0000 (10:53 +0100)
When we are not ready to handle a latency query (we are not yet prerolled) we
also don't try to forward the latency event because that might cause unexpected
errors when upstream is not yet linked.

libs/gst/base/gstbasesink.c

index 46560b8..e248399 100644 (file)
@@ -3579,6 +3579,8 @@ gst_base_sink_send_event (GstElement * element, GstEvent * event)
        * it to the clock. */
       GST_OBJECT_LOCK (element);
       basesink->priv->latency = latency;
+      if (!basesink->priv->have_latency)
+        forward = FALSE;
       GST_OBJECT_UNLOCK (element);
       GST_DEBUG_OBJECT (basesink, "latency set to %" GST_TIME_FORMAT,
           GST_TIME_ARGS (latency));