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.
This commit is contained in:
wm4 2017-07-04 14:58:34 +02:00
parent bd356333c7
commit e76d56d57b
1 changed files with 5 additions and 1 deletions

View File

@ -600,8 +600,12 @@ static void init_avctx(struct dec_video *vd, const char *decoder,
if (ctx->hwdec) { if (ctx->hwdec) {
avctx->opaque = vd; avctx->opaque = vd;
avctx->thread_count = 1; avctx->thread_count = 1;
#if HAVE_VDPAU_HWACCEL #ifdef AV_HWACCEL_FLAG_IGNORE_LEVEL
avctx->hwaccel_flags |= 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 #endif
if (ctx->hwdec->image_format) if (ctx->hwdec->image_format)
avctx->get_format = get_format_hwdec; avctx->get_format = get_format_hwdec;