Unified · Split
| @@ -120,6 +120,16 @@ static av_cold void cudascale_uninit(AVFilterContext *ctx) · 119 unmodified lines | |||
| 120 | { | 120 | { |
| 121 | CUDAScaleContext *s = ctx->priv; | 121 | CUDAScaleContext *s = ctx->priv; |
| 122 | 122 | ||
| 123 | if (s->hwctx && s->cu_module) { | ||
| 124 | CudaFunctions *cu = s->hwctx->internal->cuda_dl; | ||
| 125 | CUcontext dummy; | ||
| 126 | |||
| 127 | CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx)); | ||
| 128 | CHECK_CU(cu->cuModuleUnload(s->cu_module)); | ||
| 129 | s->cu_module = NULL; | ||
| 130 | CHECK_CU(cu->cuCtxPopCurrent(&dummy)); | ||
| 131 | } | ||
| 132 | |||
| 123 | av_frame_free(&s->frame); | 133 | av_frame_free(&s->frame); |
| 124 | av_buffer_unref(&s->frames_ctx); | 134 | av_buffer_unref(&s->frames_ctx); |
| 125 | av_frame_free(&s->tmp_frame); | 135 | av_frame_free(&s->tmp_frame); |