[vlc-commits] direct3d11: simplify the locks
Steve Lhomme
git at videolan.org
Wed Sep 27 09:23:00 CEST 2017
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Thu Sep 14 15:14:46 2017 +0200| [ddda4094039e42b510e57879fe946ed307a42456] | committer: Jean-Baptiste Kempf
direct3d11: simplify the locks
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ddda4094039e42b510e57879fe946ed307a42456
---
modules/video_output/win32/direct3d11.c | 31 +++++++------------------------
1 file changed, 7 insertions(+), 24 deletions(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 61535c5f07..18ebd4a7b3 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1131,12 +1131,6 @@ static void SetQuadVSProjection(vout_display_t *vd, d3d_quad_t *quad, const vlc_
static void UpdateSize(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
-#if defined(HAVE_ID3D11VIDEODECODER)
- if( sys->context_lock != INVALID_HANDLE_VALUE )
- {
- WaitForSingleObjectEx( sys->context_lock, INFINITE, FALSE );
- }
-#endif
msg_Dbg(vd, "Detected size change %dx%d", RECTWidth(sys->sys.rect_dest_clipped),
RECTHeight(sys->sys.rect_dest_clipped));
@@ -1144,6 +1138,13 @@ static void UpdateSize(vout_display_t *vd)
UpdatePicQuadPosition(vd);
+#if defined(HAVE_ID3D11VIDEODECODER)
+ if( sys->context_lock != INVALID_HANDLE_VALUE )
+ {
+ WaitForSingleObjectEx( sys->context_lock, INFINITE, FALSE );
+ }
+#endif
+
UpdateQuadPosition(vd, &sys->picQuad, &sys->sys.rect_src_clipped,
vd->fmt.projection_mode, vd->fmt.orientation);
@@ -1791,29 +1792,11 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
UpdateRects(vd, NULL, true);
AFTER_UPDATE_RECTS;
-#if defined(HAVE_ID3D11VIDEODECODER)
- if( sys->context_lock != INVALID_HANDLE_VALUE )
- {
- WaitForSingleObjectEx( sys->context_lock, INFINITE, FALSE );
- }
-#endif
if (Direct3D11CreateResources(vd, fmt)) {
-#if defined(HAVE_ID3D11VIDEODECODER)
- if( sys->context_lock != INVALID_HANDLE_VALUE )
- {
- ReleaseMutex( sys->context_lock );
- }
-#endif
msg_Err(vd, "Failed to allocate resources");
Direct3D11DestroyResources(vd);
return VLC_EGENERIC;
}
-#if defined(HAVE_ID3D11VIDEODECODER)
- if( sys->context_lock != INVALID_HANDLE_VALUE )
- {
- ReleaseMutex( sys->context_lock );
- }
-#endif
#if !VLC_WINSTORE_APP
EventThreadUpdateTitle(sys->sys.event, VOUT_TITLE " (Direct3D11 output)");
More information about the vlc-commits
mailing list