[vlc-devel] [PATCH 1/6] nvdec: store pointer instead of index
quentin.chateau at deepskycorp.com
quentin.chateau at deepskycorp.com
Mon Mar 30 11:26:50 CEST 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 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;
--
2.17.1
More information about the vlc-devel
mailing list