[vlc-commits] hw:d3d11: don't copy lines that will not be visible

Steve Lhomme git at videolan.org
Wed Jan 24 08:46:36 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Jan 22 17:30:59 2018 +0100| [d5ba387438a986a81aa5563afd712436c4b90d47] | committer: Jean-Baptiste Kempf

hw:d3d11: don't copy lines that will not be visible

(cherry picked from commit 3db333e33ca5589606dea8fcac3ac9c3f195d7f1)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/hw/d3d11/d3d11_surface.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/hw/d3d11/d3d11_surface.c b/modules/hw/d3d11/d3d11_surface.c
index cf066ad6fc..4bb2c750b5 100644
--- a/modules/hw/d3d11/d3d11_surface.c
+++ b/modules/hw/d3d11/d3d11_surface.c
@@ -383,7 +383,8 @@ static void D3D11_YUY2(filter_t *p_filter, picture_t *src, picture_t *dst)
             lock.RowPitch,
         };
         Copy420_SP_to_P(dst, plane, pitch,
-                        src->format.i_visible_height + src->format.i_y_offset, &sys->cache);
+                        __MIN(desc.Height, src->format.i_y_offset + src->format.i_visible_height),
+                        &sys->cache);
         picture_SwapUV(dst);
     } else {
         msg_Err(p_filter, "Unsupported D3D11VA conversion from 0x%08X to YV12", desc.Format);
@@ -492,7 +493,9 @@ static void D3D11_NV12(filter_t *p_filter, picture_t *src, picture_t *dst)
             lock.RowPitch,
             lock.RowPitch,
         };
-        Copy420_SP_to_SP(dst, plane, pitch, desc.Height, &sys->cache);
+        Copy420_SP_to_SP(dst, plane, pitch,
+                         __MIN(desc.Height, src->format.i_y_offset + src->format.i_visible_height),
+                         &sys->cache);
     } else {
         msg_Err(p_filter, "Unsupported D3D11VA conversion from 0x%08X to NV12", desc.Format);
     }



More information about the vlc-commits mailing list