diff options
author | wm4 <wm4@nowhere> | 2016-12-02 16:06:16 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-12-02 16:09:51 +0100 |
commit | a89785f2971273b3c0592a5819f9618aaabf19f9 (patch) | |
tree | cc047423fa965f06935002b769d8206e0a6f9a11 /video/decode/vdpau.c | |
parent | 09238a9bb536982e79b60a264b1d8a4fc0302975 (diff) | |
download | mpv-a89785f2971273b3c0592a5819f9618aaabf19f9.tar.bz2 mpv-a89785f2971273b3c0592a5819f9618aaabf19f9.tar.xz |
vdpau: fix vaapi probing if libvdpau-va-gl1 is present
Needs explicit logic. Fixes a pretty bad regression which prefers
vdpau-copy over native vaapi with direct rendering (with --hwdec=auto)
if libvdpau-va-gl1 is present. The reason is that vdpau-copy is above
vaapi, simply because all vdpau hwdecs are grouped and happened to be
listed before vaapi.
Although this is not that bad for copy-mode (unlike the case described
above), it's still a good idea to use our native vaapi code instead.
Diffstat (limited to 'video/decode/vdpau.c')
-rw-r--r-- | video/decode/vdpau.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c index 93a1e6d9a3..a6b6210804 100644 --- a/video/decode/vdpau.c +++ b/video/decode/vdpau.c @@ -146,12 +146,14 @@ static int probe_copy(struct lavc_ctx *ctx, struct vd_lavc_hwdec *hwdec, const char *codec) { assert(!ctx->hwdec_priv); - int r = init_copy(ctx); - if (ctx->hwdec_priv) - uninit(ctx); - ctx->hwdec_priv = NULL; - return r < 0 ? HWDEC_ERR_NO_CTX : 0; + int r = HWDEC_ERR_NO_CTX; + if (init_copy(ctx) >=0 ) { + struct priv *p = ctx->hwdec_priv; + r = mp_vdpau_guess_if_emulated(p->mpvdp) ? HWDEC_ERR_EMULATED : 0; + uninit(ctx); + } + return r; } static struct mp_image *copy_image(struct lavc_ctx *ctx, struct mp_image *img) |