From: Nicolas Dufresne Date: Thu, 15 May 2014 14:31:40 +0000 (-0400) Subject: v4l2videodec: Don't lock the decoder when stopping task X-Git-Tag: 1.19.3~509^2~4451 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f384047be390ebb8a940a0361e59ce75af5d5934;p=platform%2Fupstream%2Fgstreamer.git v4l2videodec: Don't lock the decoder when stopping task That src pad task may need to take the lock when being pulled down. takeing that lock can lead to a deadlock. https://bugzilla.gnome.org/show_bug.cgi?id=730207 --- diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c index 71481d2..9de0b54 100644 --- a/sys/v4l2/gstv4l2videodec.c +++ b/sys/v4l2/gstv4l2videodec.c @@ -213,9 +213,10 @@ gst_v4l2_video_dec_stop (GstVideoDecoder * decoder) gst_v4l2_object_unlock (self->v4l2output); gst_v4l2_object_unlock (self->v4l2capture); - GST_VIDEO_DECODER_STREAM_LOCK (decoder); /* Wait for capture thread to stop */ gst_pad_stop_task (decoder->srcpad); + + GST_VIDEO_DECODER_STREAM_LOCK (decoder); self->output_flow = GST_FLOW_OK; GST_VIDEO_DECODER_STREAM_UNLOCK (decoder); @@ -273,7 +274,9 @@ gst_v4l2_video_dec_flush (GstVideoDecoder * decoder) GST_DEBUG_OBJECT (self, "Flushing"); /* Wait for capture thread to stop */ + GST_VIDEO_DECODER_STREAM_UNLOCK (decoder); gst_pad_stop_task (decoder->srcpad); + GST_VIDEO_DECODER_STREAM_LOCK (decoder); self->output_flow = GST_FLOW_OK; if (self->v4l2output->pool)