From 6e65356017d4f7fda37810daedf8f28b44943efb Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 5 Mar 2020 13:26:38 +0100 Subject: [PATCH] vaapidecode: unlock stream if caps update fails If caps update fail a dead lock occurs since the stream mutex is not unlocked. --- gst/vaapi/gstvaapidecode.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index f8ef4ac..915cbab 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -472,17 +472,23 @@ gst_vaapidecode_negotiate (GstVaapiDecode * decode) GST_VIDEO_DECODER_STREAM_LOCK (vdec); if (!gst_vaapi_plugin_base_set_caps (plugin, decode->sinkpad_caps, NULL)) - return FALSE; + goto caps_negotiation_failed; if (!gst_vaapidecode_update_src_caps (decode)) - return FALSE; + goto caps_negotiation_failed; if (!gst_vaapi_plugin_base_set_caps (plugin, NULL, decode->srcpad_caps)) - return FALSE; + goto caps_negotiation_failed; GST_VIDEO_DECODER_STREAM_UNLOCK (vdec); if (!gst_video_decoder_negotiate (vdec)) return FALSE; return TRUE; + +caps_negotiation_failed: + { + GST_VIDEO_DECODER_STREAM_UNLOCK (vdec); + return FALSE; + } } static gboolean -- 2.7.4