Browse Source

avcodec/nvdec: Push the context before destroying the decoder

This has no visible effects but I happened to run under the cuda
memcheck tool and it called it out as an error.
tags/n4.1
Philip Langdale 7 years ago
parent
commit
2d0ee127be
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      libavcodec/nvdec.c

+ 5
- 1
libavcodec/nvdec.c View File

@@ -149,8 +149,12 @@ static void nvdec_decoder_free(void *opaque, uint8_t *data)
{
NVDECDecoder *decoder = (NVDECDecoder*)data;

if (decoder->decoder)
if (decoder->decoder) {
CUcontext dummy;
decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx);
decoder->cvdl->cuvidDestroyDecoder(decoder->decoder);
decoder->cudl->cuCtxPopCurrent(&dummy);
}

av_buffer_unref(&decoder->hw_device_ref);



Loading…
Cancel
Save