summaryrefslogtreecommitdiffstats
path: root/video/decode
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-20 11:56:31 +0100
committerwm4 <wm4@nowhere>2016-02-20 11:56:31 +0100
commitd549c4e402fbcebbab52ad00d90642bbca67963c (patch)
tree3499feaf68a0b73b2fa8101cd5ad88c878784276 /video/decode
parentf04cb7bf483616f8942b27e1237ea51ecc99e08b (diff)
downloadmpv-d549c4e402fbcebbab52ad00d90642bbca67963c.tar.bz2
mpv-d549c4e402fbcebbab52ad00d90642bbca67963c.tar.xz
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.
Diffstat (limited to 'video/decode')
-rw-r--r--video/decode/vd_lavc.c2
1 files changed, 1 insertions, 1 deletions
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