mirror of https://github.com/mpv-player/mpv
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:
parent
bd356333c7
commit
e76d56d57b
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue