[vlc-devel] [PATCH] dxva2: copy an upper round number of row/colons

Steve Lhomme robux4 at videolabs.io
Wed Mar 22 14:12:27 CET 2017


It's usually formats 4:2:0 formats being used with hardware acceleration.

It fails with BBB 480p without this patch.

The source and destination texture must have the available sizes anyway to work
properly.
---
 modules/codec/avcodec/dxva2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 7a9059b4b6..3e7a4278dc 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -259,8 +259,8 @@ static int Extract(vlc_va_t *va, picture_t *picture, uint8_t *data)
         RECT visibleSource;
         visibleSource.left = 0;
         visibleSource.top = 0;
-        visibleSource.right = picture->format.i_visible_width;
-        visibleSource.bottom = picture->format.i_visible_height;
+        visibleSource.right  = (picture->format.i_visible_width  + 0x01) & ~0x01;
+        visibleSource.bottom = (picture->format.i_visible_height + 0x01) & ~0x01;
         hr = IDirect3DDevice9_StretchRect( (IDirect3DDevice9*) dx_sys->d3ddev, d3d, &visibleSource, output, &visibleSource, D3DTEXF_NONE);
         if (FAILED(hr)) {
             msg_Err(va, "Failed to copy the hw surface to the decoder surface (hr=0x%0lx)", hr );
-- 
2.11.1



More information about the vlc-devel mailing list