[vlc-commits] d3d11_deinterlace: lock the D3D context earlier

Steve Lhomme git at videolan.org
Sun Jul 2 14:32:04 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Jun 22 09:27:10 2017 +0200| [51a731e044baa3e86d620aaa761dab8121383f04] | committer: Jean-Baptiste Kempf

d3d11_deinterlace: lock the D3D context earlier

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=51a731e044baa3e86d620aaa761dab8121383f04
---

 modules/video_output/win32/d3d11_deinterlace.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/d3d11_deinterlace.c b/modules/video_output/win32/d3d11_deinterlace.c
index 309ba51d2a..9c7ce57bfe 100644
--- a/modules/video_output/win32/d3d11_deinterlace.c
+++ b/modules/video_output/win32/d3d11_deinterlace.c
@@ -99,16 +99,21 @@ static picture_t *Deinterlace(filter_t *filter, picture_t *src)
     D3D11_VIDEO_FRAME_FORMAT frameFormat = src->b_top_field_first ?
                 D3D11_VIDEO_FRAME_FORMAT_INTERLACED_TOP_FIELD_FIRST :
                 D3D11_VIDEO_FRAME_FORMAT_INTERLACED_BOTTOM_FIELD_FIRST;
+
+    if( sys->context_mutex != INVALID_HANDLE_VALUE )
+        WaitForSingleObjectEx( sys->context_mutex, INFINITE, FALSE );
+
     ID3D11VideoContext_VideoProcessorSetStreamFrameFormat(sys->d3dvidctx, sys->videoProcessor, 0, frameFormat);
 
     hr = ID3D11VideoContext_VideoProcessorBlt(sys->d3dvidctx, sys->videoProcessor,
                                               sys->processorOutput,
                                               0, 1, &stream);
     if (FAILED(hr))
+    {
+        if( sys->context_mutex  != INVALID_HANDLE_VALUE )
+            ReleaseMutex( sys->context_mutex );
         goto error;
-
-    if( sys->context_mutex != INVALID_HANDLE_VALUE )
-        WaitForSingleObjectEx( sys->context_mutex, INFINITE, FALSE );
+    }
 
     ID3D11DeviceContext_CopySubresourceRegion(dst->p_sys->context,
                                               dst->p_sys->resource[KNOWN_DXGI_INDEX],



More information about the vlc-commits mailing list