composition: Do not try to paused the task that could have been stopped

There was a race where we ended up trying to update the pipeline and
stop our children task at the exact moment where we were actually
setting its state to PAUSED. Take the composition lock and make sure
that can't happen
This commit is contained in:
Thibault Saunier 2014-07-28 20:24:50 +02:00
parent 463626ceae
commit 8154a2c96f

View file

@ -2748,7 +2748,16 @@ update_pipeline (GnlComposition * comp, GstClockTime currenttime, gint32 seqnum,
(GstPadProbeCallback) _is_update_done_cb, ucompo,
_free_update_compo_data);
GST_OBJECT_LOCK (comp);
if (comp->task == NULL) {
GST_INFO_OBJECT (comp,
"No task set, it must have been stopped, returning");
GST_OBJECT_UNLOCK (comp);
return FALSE;
}
gst_task_pause (comp->task);
GST_OBJECT_UNLOCK (comp);
}
/* Activate stack */