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.
This commit is contained in:
wm4 2017-01-17 11:07:59 +01:00
parent 9d69eae162
commit 4b3b3a045a
1 changed files with 5 additions and 0 deletions

View File

@ -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;