summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-28 02:08:19 +0200
committerwm4 <wm4@nowhere>2014-05-28 02:08:45 +0200
commitb442b522f6d7064caaacc52021f7020b4ad4d261 (patch)
tree7c31f05964290424d582c01a15da62c88346f820 /video
parentd99f30d7266aeaa13504bce181c4410b41e9cb46 (diff)
downloadmpv-b442b522f6d7064caaacc52021f7020b4ad4d261.tar.bz2
mpv-b442b522f6d7064caaacc52021f7020b4ad4d261.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vaapi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/video/decode/vaapi.c b/video/decode/vaapi.c
index 2b951fd1bb..0e88b86c76 100644
--- a/video/decode/vaapi.c
+++ b/video/decode/vaapi.c
@@ -317,11 +317,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
@@ -355,6 +356,9 @@ static void uninit(struct lavc_ctx *ctx)
destroy_decoder(ctx);
+ talloc_free(p->pool);
+ p->pool = NULL;
+
if (p->x11_display)
destroy_va_dummy_ctx(p);