diff options
author | wm4 <wm4@nowhere> | 2017-01-17 11:07:59 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-17 15:48:56 +0100 |
commit | 4b3b3a045aa95d22fb117c0c4505c28c757c176c (patch) | |
tree | c927eafa12ec0d492c8815d6ef342e8ae0fc9ede | |
parent | 9d69eae16252e131788656ba0b8e151c4cabd1de (diff) | |
download | mpv-4b3b3a045aa95d22fb117c0c4505c28c757c176c.tar.bz2 mpv-4b3b3a045aa95d22fb117c0c4505c28c757c176c.tar.xz |
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.
-rw-r--r-- | video/decode/hw_vdpau.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |