0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

vd_lavc: simplify hwdec pixfmt check

Instead of checking whether the format is a hwaccel format, check
whether it's the exact format we've requested for hardware decoding.
This commit is contained in:
wm4 2016-02-20 11:56:31 +01:00
parent f04cb7bf48
commit d549c4e402

View File

@ -600,7 +600,7 @@ static int get_buffer2_hwdec(AVCodecContext *avctx, AVFrame *pic, int flags)
vd_ffmpeg_ctx *ctx = vd->priv;
int imgfmt = pixfmt2imgfmt(pic->format);
if (!IMGFMT_IS_HWACCEL(imgfmt) || !ctx->hwdec)
if (!ctx->hwdec || ctx->hwdec_fmt != imgfmt)
ctx->hwdec_failed = true;
/* Hardware decoding failed, and we will trigger a proper fallback later