[vlc-commits] nvdec: store pointer instead of index

Quentin Chateau git at videolan.org
Fri Apr 3 10:53:37 CEST 2020


vlc | branch: master | Quentin Chateau <quentin.chateau at deepskycorp.com> | Mon Mar 30 11:26:50 2020 +0200| [985a9518bcba8d5f64a5de0a75b5913e2ceecc33] | committer: Steve Lhomme

nvdec: store pointer instead of index

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

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

 modules/hw/nvdec/nvdec.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
index bfe7c4e30a..26f19e8a52 100644
--- a/modules/hw/nvdec/nvdec.c
+++ b/modules/hw/nvdec/nvdec.c
@@ -266,7 +266,7 @@ static int CUDAAPI HandleVideoSequence(void *p_opaque, CUVIDEOFORMAT *p_format)
             if (ret != VLC_SUCCESS || p_sys->outputDevicePtr[i] == 0)
                 goto clean_pics;
             picture_resource_t res = {
-                .p_sys = (void*)(uintptr_t)i,
+                .p_sys = p_sys->outputDevicePtr[i],
             };
             pics[i] = picture_NewFromResource( &p_dec->fmt_out.video, &res );
             if (unlikely(pics[i] == NULL))
@@ -391,8 +391,7 @@ static int CUDAAPI HandlePictureDisplay(void *p_opaque, CUVIDPARSERDISPINFO *p_d
             NVDecCtxDestroy, NVDecCtxClone,
             p_sys->vctx_out,
         };
-        uintptr_t pool_idx = (uintptr_t)p_pic->p_sys;
-        picctx->devicePtr = p_sys->outputDevicePtr[pool_idx];
+        picctx->devicePtr = (CUdeviceptr)p_pic->p_sys;
         picctx->bufferPitch = p_sys->outputPitch;
         picctx->bufferHeight = p_sys->decoderHeight;
 



More information about the vlc-commits mailing list