From 27a617d75f21f856572982509d1c0160689c8cb1 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 11 Mar 2014 14:23:32 -0400 Subject: [PATCH] v4l2videodec: Ensure processing thread has stopped when draining --- sys/v4l2/gstv4l2videodec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c index 6d367fc2c1..ff321a10f3 100644 --- a/sys/v4l2/gstv4l2videodec.c +++ b/sys/v4l2/gstv4l2videodec.c @@ -305,7 +305,12 @@ gst_v4l2_video_dec_finish (GstVideoDecoder * decoder) } GST_VIDEO_DECODER_STREAM_LOCK (decoder); - g_assert (g_atomic_int_get (&self->processing) == FALSE); + /* Ensure the processing thread has stopped */ + if (self->processing) { + gst_v4l2_object_unlock (self->v4l2capture); + gst_pad_stop_task (decoder->srcpad); + g_assert (g_atomic_int_get (&self->processing) == FALSE); + } if (ret == GST_FLOW_FLUSHING) ret = self->output_flow;