libs/gst/base/gstbasesink.c: Changing the render delay changes the latency and so...
authorWim Taymans <wim.taymans@gmail.com>
Thu, 20 Nov 2008 14:23:05 +0000 (14:23 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Thu, 20 Nov 2008 14:23:05 +0000 (14:23 +0000)
Original commit message from CVS:
* libs/gst/base/gstbasesink.c: (gst_base_sink_set_render_delay):
Changing the render delay changes the latency and so we must post a
latency message.

ChangeLog
libs/gst/base/gstbasesink.c

index 9dac74f..dff4966 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-11-20  Wim Taymans  <wim.taymans@collabora.co.uk>
 
+       * libs/gst/base/gstbasesink.c: (gst_base_sink_set_render_delay):
+       Changing the render delay changes the latency and so we must post a
+       latency message.
+
+2008-11-20  Wim Taymans  <wim.taymans@collabora.co.uk>
+
        * gst/gstquery.c:
        * gst/gstquery.h:
        Add GstQueryType for custom queries instead of having to use the
index f77c46c..7df01c5 100644 (file)
@@ -1025,13 +1025,22 @@ gst_base_sink_query_latency (GstBaseSink * sink, gboolean * live,
 void
 gst_base_sink_set_render_delay (GstBaseSink * sink, GstClockTime delay)
 {
+  GstClockTime old_render_delay;
+
   g_return_if_fail (GST_IS_BASE_SINK (sink));
 
   GST_OBJECT_LOCK (sink);
+  old_render_delay = sink->priv->render_delay;
   sink->priv->render_delay = delay;
   GST_LOG_OBJECT (sink, "set render delay to %" GST_TIME_FORMAT,
       GST_TIME_ARGS (delay));
   GST_OBJECT_UNLOCK (sink);
+
+  if (delay != old_render_delay) {
+    GST_DEBUG_OBJECT (sink, "posting latency changed");
+    gst_element_post_message (GST_ELEMENT_CAST (sink),
+        gst_message_new_latency (GST_OBJECT_CAST (sink)));
+  }
 }
 
 /**