[vlc-commits] d3d11va: only copy the usable area

Steve Lhomme git at videolan.org
Tue Aug 2 10:54:55 CEST 2016


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Aug  2 08:28:08 2016 +0200| [4b937a24920a0ab7cab921e28366ea2e37c446b5] | committer: Jean-Baptiste Kempf

d3d11va: only copy the usable area

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.

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

 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;



More information about the vlc-commits mailing list