From b8f025a58a8dddc42442527229a20b7e45edcc22 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 11 Aug 2014 23:08:35 +0200 Subject: video: don't keep multiple pointers to hwdec info struct This makes a certain corner case simpler at a later point. --- video/out/vo_vaapi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'video/out/vo_vaapi.c') diff --git a/video/out/vo_vaapi.c b/video/out/vo_vaapi.c index 7e32563395..3c760ac07c 100644 --- a/video/out/vo_vaapi.c +++ b/video/out/vo_vaapi.c @@ -70,6 +70,7 @@ struct priv { struct vo *vo; VADisplay display; struct mp_vaapi_ctx *mpvaapi; + struct mp_hwdec_info hwdec_info; struct mp_image_params image_params; struct mp_rect src_rect; @@ -516,8 +517,8 @@ static int control(struct vo *vo, uint32_t request, void *data) p->deint = *(int*)data ? p->deint_type : 0; return VO_TRUE; case VOCTRL_GET_HWDEC_INFO: { - struct mp_hwdec_info *arg = data; - arg->vaapi_ctx = p->mpvaapi; + struct mp_hwdec_info **arg = data; + *arg = &p->hwdec_info; return true; } case VOCTRL_GET_COLORSPACE: { @@ -598,6 +599,8 @@ static int preinit(struct vo *vo) goto fail; } + p->hwdec_info.vaapi_ctx = p->mpvaapi; + if (va_guess_if_emulated(p->mpvaapi)) { MP_WARN(vo, "VA-API is most likely emulated via VDPAU.\n" "It's better to use VDPAU directly with: --vo=vdpau\n"); -- cgit v1.2.3