From 6265a2d7793c52b16f48f6f8db5d8833d350abc5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 Sep 2017 16:51:30 +0200 Subject: vaapi: minor changes This is for relicensing. Some of this code is loosely based on vo_vaapi.c from the original MPlayer-vaapi patches. Most of the code has changed, and only the initialization code and check_status() look remotely similar. The initialization code is changed to be like Libav's (hwcontext_vaapi.c). check_va_status() is just a C idiom, but to play it safe, we'll either drop it from LGPL code (or recreate it). vaapi.c still contains plenty of code from the original patches, but the next commits will move them out of the LGPL code paths. --- video/vaapi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'video') diff --git a/video/vaapi.c b/video/vaapi.c index 5f22dbb28a..f977b054e4 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -192,14 +192,14 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog, vaSetInfoCallback(va_info_callback); #endif - int major_version, minor_version; - int status = vaInitialize(display, &major_version, &minor_version); - if (status != VA_STATUS_SUCCESS && probing) - goto error; - if (!check_va_status(res->log, status, "vaInitialize()")) + int major, minor; + int status = vaInitialize(display, &major, &minor); + if (status != VA_STATUS_SUCCESS) { + if (!probing) + MP_ERR(res, "Failed to initialize VAAPI: %s\n", vaErrorStr(status)); goto error; - - MP_VERBOSE(res, "VA API version %d.%d\n", major_version, minor_version); + } + MP_VERBOSE(res, "Initialized VAAPI: version %d.%d\n", major, minor); va_get_formats(res); if (!res->image_formats) -- cgit v1.2.3