Commit 2d0ee127 authored by Philip Langdale's avatar Philip Langdale

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.
parent 22d6d916
...@@ -149,8 +149,12 @@ static void nvdec_decoder_free(void *opaque, uint8_t *data) ...@@ -149,8 +149,12 @@ static void nvdec_decoder_free(void *opaque, uint8_t *data)
{ {
NVDECDecoder *decoder = (NVDECDecoder*)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->cvdl->cuvidDestroyDecoder(decoder->decoder);
decoder->cudl->cuCtxPopCurrent(&dummy);
}
av_buffer_unref(&decoder->hw_device_ref); av_buffer_unref(&decoder->hw_device_ref);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment