From b5b3aadf40b5a94d79b4ec3f1d3a1892eba01f6a Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 29 Apr 2017 15:09:26 +0200 Subject: [PATCH] vdpau, vaapi: unref libavutil device ref It's a simple memory leak. (The API objects were destroyed anyway.) --- video/vaapi.c | 2 ++ video/vdpau.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/video/vaapi.c b/video/vaapi.c index 171ccdfcbd..76a197cca2 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -224,6 +224,8 @@ error: void va_destroy(struct mp_vaapi_ctx *ctx) { if (ctx) { + av_buffer_unref(&ctx->av_device_ref); + if (ctx->display) vaTerminate(ctx->display); diff --git a/video/vdpau.c b/video/vdpau.c index 8895053249..fa79e9bc67 100644 --- a/video/vdpau.c +++ b/video/vdpau.c @@ -481,6 +481,8 @@ void mp_vdpau_destroy(struct mp_vdpau_ctx *ctx) CHECK_VDP_WARNING(ctx, "Error when calling vdp_output_surface_destroy"); } + av_buffer_unref(&ctx->av_device_ref); + if (ctx->preemption_obj != VDP_INVALID_HANDLE) { vdp_st = vdp->output_surface_destroy(ctx->preemption_obj); CHECK_VDP_WARNING(ctx, "Error when calling vdp_output_surface_destroy");