[vlc-devel] [PATCH 4/4] direct3d11: make sure there's no pending operation after leaving Prepare()

Steve Lhomme robux4 at videolabs.io
Mon Apr 10 16:07:27 CEST 2017


---
 modules/video_output/win32/direct3d11.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 34b0a651e6..8f02d6d7a2 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1226,6 +1226,19 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
                                                   0, 0, 0, 0,
                                                   p_sys->resource[KNOWN_DXGI_INDEX],
                                                   p_sys->slice_index, &box);
+        ID3D11DeviceContext_Flush(sys->d3dcontext);
+#if defined(HAVE_ID3D11VIDEODECODER)
+        if ( sys->context_lock != INVALID_HANDLE_VALUE)
+            ReleaseMutex( sys->context_lock );
+#endif
+    } else {
+#if defined(HAVE_ID3D11VIDEODECODER)
+        if( sys->context_lock != INVALID_HANDLE_VALUE )
+        {
+            WaitForSingleObjectEx( sys->context_lock, INFINITE, FALSE );
+        }
+#endif
+        ID3D11DeviceContext_Flush(sys->d3dcontext);
 #if defined(HAVE_ID3D11VIDEODECODER)
         if ( sys->context_lock != INVALID_HANDLE_VALUE)
             ReleaseMutex( sys->context_lock );
-- 
2.11.1



More information about the vlc-devel mailing list