From 4b3b3a045aa95d22fb117c0c4505c28c757c176c Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 17 Jan 2017 11:07:59 +0100 Subject: vdpau: reject decoding of non-4:2:0 Tried to decode a High 4:2:2 file, since libavcodec code seemed to indicate that it's supported. Well, it decodes to garbage. I couldn't find out why ffmpeg.c actually appears to reject this correctly. The API seems to be fine with, just that the output is garbage. Add a hack for now. --- video/decode/hw_vdpau.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'video') diff --git a/video/decode/hw_vdpau.c b/video/decode/hw_vdpau.c index a3ff0e2048..6047ef1360 100644 --- a/video/decode/hw_vdpau.c +++ b/video/decode/hw_vdpau.c @@ -39,6 +39,11 @@ static int init_decoder(struct lavc_ctx *ctx, int w, int h) struct priv *p = ctx->hwdec_priv; int sw_format = ctx->avctx->sw_pix_fmt; + if (sw_format != AV_PIX_FMT_YUV420P && sw_format != AV_PIX_FMT_NV12) { + MP_VERBOSE(ctx, "Rejecting non 4:2:0 8 bit decoding.\n"); + return -1; + } + if (hwdec_setup_hw_frames_ctx(ctx, p->mpvdp->av_device_ref, sw_format, 0) < 0) return -1; -- cgit v1.2.3