From: Wonchul Lee Date: Fri, 19 Nov 2021 04:27:54 +0000 (+0900) Subject: d3d11: Fix deadlock while doing unprepare X-Git-Tag: 1.20.0~271 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae7a3652747ecabd6086b1d326efccfb1a82969f;p=platform%2Fupstream%2Fgstreamer.git d3d11: Fix deadlock while doing unprepare ShowWindow() could be blocked while doing gst_d3d11_window_win32_unprepare when external window handle provided to d3d11videosink in multi-threaded environment. The condition that issue happened is, UI thread is waiting for a background thread that changes d3d11videosink state to NULL, and the background thread would try to send a window message to the queue. The queue is already occupied by the UI thread, so the background thread will be blocked. Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window_win32.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window_win32.cpp index 6261c97..cba1031 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window_win32.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11window_win32.cpp @@ -208,7 +208,6 @@ gst_d3d11_window_win32_unprepare (GstD3D11Window * window) if (self->external_hwnd) { gst_d3d11_window_win32_release_external_handle (self->external_hwnd); RemoveProp (self->internal_hwnd, D3D11_WINDOW_PROP_NAME); - ShowWindow (self->internal_hwnd, SW_HIDE); if (self->internal_hwnd_thread == g_thread_self ()) { /* State changing thread is identical to internal window thread.