mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avcodec/nvenc: unregister input resource when unmapping
Currently the resource is only ever unregistered when the registered_frames array is fully in use and an unmapped entry is re-used and cleaned up. I'm pretty sure the frame will have been cleaned up before that happens, so I'm kinda surprised this never blew up. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
parent
bbe1b21022
commit
32bc4e77f6
@ -1797,6 +1797,8 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
|
||||
ctx->registered_frames[tmpoutsurf->reg_idx].mapped -= 1;
|
||||
if (ctx->registered_frames[tmpoutsurf->reg_idx].mapped == 0) {
|
||||
p_nvenc->nvEncUnmapInputResource(ctx->nvencoder, ctx->registered_frames[tmpoutsurf->reg_idx].in_map.mappedResource);
|
||||
p_nvenc->nvEncUnregisterResource(ctx->nvencoder, ctx->registered_frames[tmpoutsurf->reg_idx].regptr);
|
||||
ctx->registered_frames[tmpoutsurf->reg_idx].regptr = NULL;
|
||||
} else if (ctx->registered_frames[tmpoutsurf->reg_idx].mapped < 0) {
|
||||
res = AVERROR_BUG;
|
||||
goto error;
|
||||
|
Loading…
Reference in New Issue
Block a user