From e76d56d57bb0382cc33bdf0a4c2eaa08b3c315c4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 4 Jul 2017 14:58:34 +0200 Subject: vd_lavc: make --vd-lavc-check-hw-profile=no work for generic hwaccels This sets AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH, which some hwaccels using the new generic API respect. These do profile selection in libavcodec, so it can be controlled only with an external flag, instead of in mpv code like it used to be done. --- video/decode/vd_lavc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index a36adbf334..b7ab23f89d 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -600,8 +600,12 @@ static void init_avctx(struct dec_video *vd, const char *decoder, if (ctx->hwdec) { avctx->opaque = vd; avctx->thread_count = 1; -#if HAVE_VDPAU_HWACCEL +#ifdef AV_HWACCEL_FLAG_IGNORE_LEVEL avctx->hwaccel_flags |= AV_HWACCEL_FLAG_IGNORE_LEVEL; +#endif +#ifdef AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH + if (!lavc_param->check_hw_profile) + avctx->hwaccel_flags |= AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH; #endif if (ctx->hwdec->image_format) avctx->get_format = get_format_hwdec; -- cgit v1.2.3