From 2af44842c6d3cde3d3a6788bdcd149802fb75908 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 12 Aug 2014 13:00:03 +0300 Subject: [PATCH] vaapidecode: unlock condition variables before shutting down the element Otherwise threads might wait for them, causing the shutdown of the element to deadlock on the streaming thread. https://bugzilla.gnome.org/show_bug.cgi?id=734616 --- gst/vaapi/gstvaapidecode.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 15620a2..aab99ad 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -929,7 +929,13 @@ gst_vaapidecode_change_state (GstElement * element, GstStateChange transition) switch (transition) { case GST_STATE_CHANGE_PAUSED_TO_READY: + g_mutex_lock(&decode->decoder_mutex); + decode->decoder_finish = TRUE; + g_cond_signal(&decode->decoder_finish_done); + g_cond_signal(&decode->decoder_ready); + g_mutex_unlock(&decode->decoder_mutex); gst_pad_stop_task(GST_VAAPI_PLUGIN_BASE_SRC_PAD(decode)); + decode->decoder_finish = FALSE; break; default: break; -- 2.7.4