diff options
author | wm4 <wm4@nowhere> | 2015-06-20 22:26:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-20 22:26:57 +0200 |
commit | 991af7dfb10c514a10d84f5a3e2698e646eb53d4 (patch) | |
tree | 03816e23f1b58bad4b6ca0249006d953096acd0a /video/vaapi.c | |
parent | b17b8ff7fe91be294ffb229c0c143da7a6425fca (diff) | |
download | mpv-991af7dfb10c514a10d84f5a3e2698e646eb53d4.tar.bz2 mpv-991af7dfb10c514a10d84f5a3e2698e646eb53d4.tar.xz |
video: reduce error message when loading hwdec backend fails
When using --hwdec=auto, about half of all systems will print:
"[vdpau] Error when calling vdp_device_create_x11: 1"
this happens because usually mpv will be linked against both vdpau and
vaapi libs, but the drivers are not necessarily available. Then trying
to load a driver will fail. This is a normal part of probing, but the
error messages were printed anyway. Silence them by explicitly
distinguishing probing.
This pretty much goes through all the layers. We actually consider
loading hw backends for vo_opengl always "auto probed", even if a hw
backend is explicitly requested. In this case vd_lavc will print a
warning message anyway (adjust this message a bit).
Diffstat (limited to 'video/vaapi.c')
-rw-r--r-- | video/vaapi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/video/vaapi.c b/video/vaapi.c index 8b95dde85d..df2022ce01 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -114,12 +114,15 @@ static void va_get_formats(struct mp_vaapi_ctx *ctx) ctx->image_formats = formats; } -struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog) +struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog, + bool probing) { struct mp_vaapi_ctx *res = NULL; struct mp_log *log = mp_log_new(NULL, plog, "/vaapi"); 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(log, status, "vaInitialize()")) goto error; |