summaryrefslogtreecommitdiffstats
path: root/video/out/vo_vaapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/vo_vaapi.c')
-rw-r--r--video/out/vo_vaapi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c
index 4d64487746..cc5907ec2a 100644
--- a/video/out/vo_vaapi.c
+++ b/video/out/vo_vaapi.c
@@ -571,16 +571,17 @@ static int preinit(struct vo *vo)
VAStatus status;
if (!vo_x11_init(vo))
- return -1;
+ goto fail;
p->display = vaGetDisplay(vo->x11->display);
if (!p->display)
- return -1;
+ goto fail;
p->mpvaapi = va_initialize(p->display, p->log);
if (!p->mpvaapi) {
vaTerminate(p->display);
- return -1;
+ p->display = NULL;
+ goto fail;
}
p->pool = va_surface_pool_alloc(p->mpvaapi, VA_RT_FORMAT_YUV420);
@@ -630,6 +631,10 @@ static int preinit(struct vo *vo)
p->va_num_display_attrs = 0;
}
return 0;
+
+fail:
+ uninit(vo);
+ return -1;
}
#define OPT_BASE_STRUCT struct priv