summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-02-17 13:54:55 +0100
committerwm4 <wm4@nowhere>2016-02-17 13:54:55 +0100
commitf371367aac54402cca4627c0d1660eed05695ba0 (patch)
treede17e73696543c5709c977e38a38c3e90b36759b
parent3dfb07854b3143d59681fd65f7dd7c3ba65e1d2f (diff)
downloadmpv-f371367aac54402cca4627c0d1660eed05695ba0.tar.bz2
mpv-f371367aac54402cca4627c0d1660eed05695ba0.tar.xz
dxva2: avoid using AV_PIX_FMT_P010 directly
The new code is essentially equivalent, but compiles against older ffmpeg. Fixes #2832.
-rw-r--r--video/decode/dxva2.c7
1 files 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;
}
}