[vlc-devel] [PATCH] d3d11va: only copy the usable area

Steve Lhomme robux4 at videolabs.io
Tue Aug 2 08:28:08 CEST 2016


The output texture may be smaller than the input. Not knowing if there's any
check in D3D11 it's better to be safe than sorry.
---
 modules/codec/avcodec/d3d11va.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index bf40ad6..7f75b93 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -312,11 +312,14 @@ static int Extract(vlc_va_t *va, picture_t *output, uint8_t *data)
             ID3D11VideoDecoderOutputView_GetDesc( src, &viewDesc );
 
             /* copy decoder slice to surface */
+            D3D11_BOX copyBox = {
+                .right = dstDesc.Width, .bottom = dstDesc.Height, .back = 1,
+            };
             ID3D11DeviceContext_CopySubresourceRegion(sys->d3dctx, (ID3D11Resource*) p_sys_out->texture,
                                                       0, 0, 0, 0,
                                                       (ID3D11Resource*) p_sys_in->texture,
                                                       viewDesc.Texture2D.ArraySlice,
-                                                      NULL);
+                                                      &copyBox);
         }
     }
         break;
-- 
2.8.2



More information about the vlc-devel mailing list