From 8154a2c96f95a2c2a5aae57360c65b29de09f561 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 28 Jul 2014 20:24:50 +0200 Subject: [PATCH] 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 --- gnl/gnlcomposition.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c index 1bfe590c13..ae95323fcb 100644 --- a/gnl/gnlcomposition.c +++ b/gnl/gnlcomposition.c @@ -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 */