[vlc-commits] d3d11_quad: fix YUVA viewport on NV12/P010

Steve Lhomme git at videolan.org
Mon May 28 13:25:57 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan 16 12:01:22 2018 +0100| [5d6f8407235900709fce0aee6e3a652d8f583609] | committer: Steve Lhomme

d3d11_quad: fix YUVA viewport on NV12/P010

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

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

diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index 458c2433e5..364208f04e 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -861,9 +861,14 @@ void D3D11_UpdateViewport(d3d_quad_t *quad, const RECT *rect, const d3d_format_t
         switch ( quad->formatInfo->fourcc )
         {
         case VLC_CODEC_YUVA:
-            quad->cropViewport[1] = quad->cropViewport[2] =
-            quad->cropViewport[3] = quad->cropViewport[0];
-            break;
+            if ( display->formatTexture != DXGI_FORMAT_NV12 &&
+                 display->formatTexture != DXGI_FORMAT_P010 )
+            {
+                quad->cropViewport[1] = quad->cropViewport[2] =
+                quad->cropViewport[3] = quad->cropViewport[0];
+                break;
+            }
+            /* fallthrough */
         case VLC_CODEC_I420:
             quad->cropViewport[1].TopLeftX = quad->cropViewport[0].TopLeftX / 2;
             quad->cropViewport[1].TopLeftY = quad->cropViewport[0].TopLeftY / 2;



More information about the vlc-commits mailing list