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
This commit is contained in:
Sebastian Dröge 2015-12-07 17:25:02 +02:00
parent d10c488d63
commit 2d427c75ae

View file

@ -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: