summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-02 04:27:02 +0100
committerwm4 <wm4@nowhere>2017-12-02 04:53:51 +0100
commit23a9efd124042e7c97f8317bcd8ae5903d039ef7 (patch)
tree8af4a34bd494abe51608d3648de612d5af920314 /video/decode/vd_lavc.c
parent0780d3832997056b581cdecb29e605132fae9417 (diff)
downloadmpv-23a9efd124042e7c97f8317bcd8ae5903d039ef7.tar.bz2
mpv-23a9efd124042e7c97f8317bcd8ae5903d039ef7.tar.xz
vd_lavc, vdpau, vaapi: restore emulated API avoidance
This code is for trying to avoid using an emulation layer when using auto probing, so that we end up using the actual API the drivers provide. It was destroyed in the recent refactor.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 5e9b30d453..aac9f81839 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -458,6 +458,17 @@ static void select_and_set_hwdec(struct dec_video *vd)
MP_VERBOSE(vd, "Could not create device.\n");
continue;
}
+
+ const struct hwcontext_fns *fns =
+ hwdec_get_hwcontext_fns(hwdec->lavc_device);
+ if (fns && fns->is_emulated && fns->is_emulated(ctx->hwdec_dev)) {
+ if (hwdec_auto) {
+ MP_VERBOSE(vd, "Not using emulated API.\n");
+ av_buffer_unref(&ctx->hwdec_dev);
+ continue;
+ }
+ MP_WARN(vd, "Using emulated hardware decoding API.\n");
+ }
}
ctx->use_hwdec = true;