[vlc-devel] [PATCH 1/6] nvdec: store pointer instead of index

quentin.chateau at deepskycorp.com quentin.chateau at deepskycorp.com
Wed Mar 25 18:57:37 CET 2020


From: Quentin Chateau <quentin.chateau at deepskycorp.com>

---
 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 76aec6a246..05a54c555d 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 = (void*)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;
 
-- 
2.17.1



More information about the vlc-devel mailing list