From 0da96385765840c418a789d06ec66c918b59d7ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 15 Aug 2013 18:20:15 +0200 Subject: video/decode: pass parameters directly to hwdec allocate_image callback Instead of passing AVFrame. This also moves the mysterious logic about the size of the allocated image to common code, instead of duplicating it everywhere. --- video/decode/vd_lavc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 639e46ebcc..c899e53206 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -565,7 +565,11 @@ static struct mp_image *get_surface_hwdec(struct sh_video *sh, AVFrame *pic) if (!IMGFMT_IS_HWACCEL(imgfmt)) return NULL; - struct mp_image *mpi = ctx->hwdec->allocate_image(ctx, pic); + // frame->width/height lie. Using them breaks with non-mod 16 video. + int w = ctx->avctx->width; + int h = ctx->avctx->height; + + struct mp_image *mpi = ctx->hwdec->allocate_image(ctx, imgfmt, w, h); if (mpi) { for (int i = 0; i < 4; i++) -- cgit v1.2.3