From f371367aac54402cca4627c0d1660eed05695ba0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 17 Feb 2016 13:54:55 +0100 Subject: dxva2: avoid using AV_PIX_FMT_P010 directly The new code is essentially equivalent, but compiles against older ffmpeg. Fixes #2832. --- video/decode/dxva2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/video/decode/dxva2.c b/video/decode/dxva2.c index 220a97d504..987da326d0 100644 --- a/video/decode/dxva2.c +++ b/video/decode/dxva2.c @@ -494,13 +494,14 @@ static int dxva2_create_decoder(struct lavc_ctx *s, int w, int h, target_format = format; } } else { - if (format == MKTAG('P','0','1','0') || - format == MKTAG('P','0','1','6')) + int p010 = mp_imgfmt_find(1, 1, 2, 10, MP_IMGFLAG_YUV_NV); + if (p010 && (format == MKTAG('P','0','1','0') || + format == MKTAG('P','0','1','6'))) { // There is no FFmpeg format that is like NV12 and supports // 16 bit per component, but vo_opengl will use the lower // bits in P010 anyway. - ctx->mp_format = pixfmt2imgfmt(AV_PIX_FMT_P010); + ctx->mp_format = p010; target_format = format; } } -- cgit v1.2.3