Commit b79e5e35 authored by Thibault Saunier's avatar Thibault Saunier 🌵 Committed by GStreamer Marge Bot

nlecomposition: Add stack initialization action after setting our state

Otherwise there is a pretty rare race where we get the
_initialize_stack_func executed leading to the stack set up and
the source pushing buffers before the composition source pad is
activated, and a STREAM_ERROR is reported as we end up pushing a
buffer to a flushing pad.

Thanks rr chaos mode for showing that improbable race

Part-of: <!175>
parent 56544604
......@@ -2637,14 +2637,6 @@ nle_composition_change_state (GstElement * element, GstStateChange transition)
_set_all_children_state (comp, GST_STATE_READY);
_start_task (comp);
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
/* state-lock all elements */
GST_DEBUG_OBJECT (comp,
"Setting all children to READY and locking their state");
_add_update_compo_action (comp, G_CALLBACK (_initialize_stack_func),
COMP_UPDATE_STACK_INITIALIZE);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
_stop_task (comp);
......@@ -2682,6 +2674,14 @@ nle_composition_change_state (GstElement * element, GstStateChange transition)
}
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
/* state-lock all elements */
GST_DEBUG_OBJECT (comp,
"Setting all children to READY and locking their state");
_add_update_compo_action (comp, G_CALLBACK (_initialize_stack_func),
COMP_UPDATE_STACK_INITIALIZE);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
comp->priv->tearing_down_stack = FALSE;
nle_composition_reset (comp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment