From 2d427c75aebeb53faaedec581e66f69321fd7e78 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 7 Dec 2015 17:25:02 +0200 Subject: [PATCH] bin: Post a LATENCY message with async-handling=TRUE if the PLAYING state is reached Otherwise each bin might have a different latency in the end, causing synchronization problems. The bin will still first handle latency internally as before, but gives the overall pipeline the opportunity to update the latency of the whole pipeline afterwards. https://bugzilla.gnome.org/show_bug.cgi?id=759125 --- gst/gstbin.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/gstbin.c b/gst/gstbin.c index 38c5ec8..4fb1cd9 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -2668,14 +2668,18 @@ gst_bin_change_state_func (GstElement * element, GstStateChange transition) switch (next) { case GST_STATE_PLAYING: { - gboolean toplevel; + gboolean toplevel, asynchandling; GST_OBJECT_LOCK (bin); toplevel = BIN_IS_TOPLEVEL (bin); + asynchandling = bin->priv->asynchandling; GST_OBJECT_UNLOCK (bin); if (toplevel) gst_bin_recalculate_latency (bin); + if (asynchandling) + gst_element_post_message (element, + gst_message_new_latency (GST_OBJECT_CAST (element))); break; } case GST_STATE_PAUSED: -- 2.7.4