From d549c4e402fbcebbab52ad00d90642bbca67963c Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 20 Feb 2016 11:56:31 +0100 Subject: 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. --- video/decode/vd_lavc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index ed4b347392..0520c3a4fd 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -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 -- cgit v1.2.3