summaryrefslogtreecommitdiffstats
path: root/video/vdpau.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-20 22:26:57 +0200
committerwm4 <wm4@nowhere>2015-06-20 22:26:57 +0200
commit991af7dfb10c514a10d84f5a3e2698e646eb53d4 (patch)
tree03816e23f1b58bad4b6ca0249006d953096acd0a /video/vdpau.c
parentb17b8ff7fe91be294ffb229c0c143da7a6425fca (diff)
downloadmpv-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/vdpau.c')
-rw-r--r--video/vdpau.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/video/vdpau.c b/video/vdpau.c
index 339fb59d54..55ca8d95ce 100644
--- a/video/vdpau.c
+++ b/video/vdpau.c
@@ -113,7 +113,7 @@ static void preemption_callback(VdpDevice device, void *context)
pthread_mutex_unlock(&ctx->preempt_lock);
}
-static int win_x11_init_vdpau_procs(struct mp_vdpau_ctx *ctx)
+static int win_x11_init_vdpau_procs(struct mp_vdpau_ctx *ctx, bool probing)
{
Display *x11 = ctx->x11;
VdpStatus vdp_st;
@@ -142,11 +142,14 @@ static int win_x11_init_vdpau_procs(struct mp_vdpau_ctx *ctx)
vdp_st = vdp_device_create_x11(x11, DefaultScreen(x11), &ctx->vdp_device,
&get_proc_address);
if (vdp_st != VDP_STATUS_OK) {
- if (ctx->is_preempted)
+ if (ctx->is_preempted) {
MP_DBG(ctx, "Error calling vdp_device_create_x11 while preempted: %d\n",
vdp_st);
- else
- MP_ERR(ctx, "Error when calling vdp_device_create_x11: %d\n", vdp_st);
+ } else {
+ int lev = probing ? MSGL_V : MSGL_ERR;
+ mp_msg(ctx->log, lev, "Error when calling vdp_device_create_x11: %d\n",
+ vdp_st);
+ }
return -1;
}
@@ -182,7 +185,7 @@ static int handle_preemption(struct mp_vdpau_ctx *ctx)
if (ctx->last_preemption_retry_fail &&
mp_time_sec() - ctx->last_preemption_retry_fail < 1.0)
return -1;
- if (win_x11_init_vdpau_procs(ctx) < 0) {
+ if (win_x11_init_vdpau_procs(ctx, false) < 0) {
ctx->last_preemption_retry_fail = mp_time_sec();
return -1;
}
@@ -369,7 +372,8 @@ struct mp_image *mp_vdpau_get_video_surface(struct mp_vdpau_ctx *ctx,
return mp_vdpau_get_surface(ctx, chroma, 0, false, w, h);
}
-struct mp_vdpau_ctx *mp_vdpau_create_device_x11(struct mp_log *log, Display *x11)
+struct mp_vdpau_ctx *mp_vdpau_create_device_x11(struct mp_log *log, Display *x11,
+ bool probing)
{
struct mp_vdpau_ctx *ctx = talloc_ptrtype(NULL, ctx);
*ctx = (struct mp_vdpau_ctx) {
@@ -389,7 +393,7 @@ struct mp_vdpau_ctx *mp_vdpau_create_device_x11(struct mp_log *log, Display *x11
mark_vdpau_objects_uninitialized(ctx);
- if (win_x11_init_vdpau_procs(ctx) < 0) {
+ if (win_x11_init_vdpau_procs(ctx, probing) < 0) {
mp_vdpau_destroy(ctx);
return NULL;
}