From ff2e39a3d28ce4f08a4683577844cd0f2f6c7fb2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 28 May 2014 02:08:19 +0200 Subject: vaapi: fix destruction with --hwdec=haapi-copy This is incomplete; the video chain will still hold some vaapi objects after destroying the decoder and thus the vaapi context. This is very bad. Fixing it would require something like refcounting the vaapi context, but I don't really want to. --- video/decode/vaapi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/video/decode/vaapi.c b/video/decode/vaapi.c index d4b1c41840..9142bc2a62 100644 --- a/video/decode/vaapi.c +++ b/video/decode/vaapi.c @@ -334,11 +334,12 @@ static struct mp_image *allocate_image(struct lavc_ctx *ctx, int format, static void destroy_va_dummy_ctx(struct priv *p) { + va_destroy(p->ctx); + p->ctx = NULL; + p->display = NULL; if (p->x11_display) XCloseDisplay(p->x11_display); p->x11_display = NULL; - va_destroy(p->ctx); - p->ctx = NULL; } // Creates a "private" VADisplay, disconnected from the VO. We just create a @@ -372,6 +373,7 @@ static void uninit(struct lavc_ctx *ctx) destroy_decoder(ctx); va_surface_pool_release(p->pool); + p->pool = NULL; if (p->x11_display) destroy_va_dummy_ctx(p); -- cgit v1.2.3