composition: Only sync state of current bin when activating new stack.
authorMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Sat, 12 Jul 2014 18:54:55 +0000 (20:54 +0200)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 31 Oct 2014 10:58:10 +0000 (11:58 +0100)
Co-Authored by: Thibault Saunier <tsaunier@gnome.org>

gnl/gnlcomposition.c

index d0ece2b..e8e621f 100644 (file)
@@ -2791,8 +2791,6 @@ static void
 _relink_new_stack (GnlComposition * comp, GNode * stack,
     GstEvent * toplevel_seek)
 {
-  GnlCompositionPrivate *priv = comp->priv;
-
   GST_INFO_OBJECT (comp, "Reseting seqnum to %i",
       gst_event_get_seqnum (toplevel_seek));
   GNL_OBJECT (comp)->wanted_seqnum = gst_event_get_seqnum (toplevel_seek);
@@ -2800,9 +2798,6 @@ _relink_new_stack (GnlComposition * comp, GNode * stack,
   _relink_single_node (comp, stack, toplevel_seek);
 
   gst_event_unref (toplevel_seek);
-
-  gst_element_set_locked_state (priv->current_bin, FALSE);
-  gst_element_sync_state_with_parent (priv->current_bin);
 }
 
 /* static void
@@ -2883,7 +2878,7 @@ _activate_new_stack (GnlComposition * comp)
 
     GST_DEBUG_OBJECT (comp, "Nothing else in the composition"
         ", update 'worked'");
-    return TRUE;
+    goto resync_state;
   }
 
   priv->stackvalid = TRUE;
@@ -2900,6 +2895,13 @@ _activate_new_stack (GnlComposition * comp)
   gnl_composition_ghost_pad_set_target (comp, pad, topentry);
 
   GST_DEBUG_OBJECT (comp, "New stack activated!");
+
+resync_state:
+  gst_element_set_locked_state (priv->current_bin, FALSE);
+  GST_ERROR ("going back to parent state");
+  gst_element_sync_state_with_parent (priv->current_bin);
+  GST_ERROR ("gone back to parent state");
+
   return TRUE;
 }