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
1 changed files with 1 additions and 1 deletions

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