1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 23:02:37 +00:00

dxva2: avoid using AV_PIX_FMT_P010 directly

The new code is essentially equivalent, but compiles against older
ffmpeg.

Fixes #2832.
This commit is contained in:
wm4 2016-02-17 13:54:55 +01:00
parent 3dfb07854b
commit f371367aac

View File

@ -494,13 +494,14 @@ static int dxva2_create_decoder(struct lavc_ctx *s, int w, int h,
target_format = format; target_format = format;
} }
} else { } else {
if (format == MKTAG('P','0','1','0') || int p010 = mp_imgfmt_find(1, 1, 2, 10, MP_IMGFLAG_YUV_NV);
format == MKTAG('P','0','1','6')) 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 // There is no FFmpeg format that is like NV12 and supports
// 16 bit per component, but vo_opengl will use the lower // 16 bit per component, but vo_opengl will use the lower
// bits in P010 anyway. // bits in P010 anyway.
ctx->mp_format = pixfmt2imgfmt(AV_PIX_FMT_P010); ctx->mp_format = p010;
target_format = format; target_format = format;
} }
} }