diff options
author | wm4 <wm4@nowhere> | 2013-08-15 18:20:15 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-08-15 23:40:02 +0200 |
commit | 0da96385765840c418a789d06ec66c918b59d7ce (patch) | |
tree | d7ae53619256e17f9a7c901046af9dffc52786a6 /video/decode/vdpau.c | |
parent | 30f2db5930993184e125aa5ee46c73002f5de745 (diff) | |
download | mpv-0da96385765840c418a789d06ec66c918b59d7ce.tar.bz2 mpv-0da96385765840c418a789d06ec66c918b59d7ce.tar.xz |
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.
Diffstat (limited to 'video/decode/vdpau.c')
-rw-r--r-- | video/decode/vdpau.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c index e20abdafca..e0d3241803 100644 --- a/video/decode/vdpau.c +++ b/video/decode/vdpau.c @@ -157,17 +157,14 @@ fail: return false; } -static struct mp_image *allocate_image(struct lavc_ctx *ctx, AVFrame *frame) +static struct mp_image *allocate_image(struct lavc_ctx *ctx, int fmt, + int w, int h) { struct priv *p = ctx->hwdec_priv; - if (frame->format != AV_PIX_FMT_VDPAU) + if (fmt != IMGFMT_VDPAU) return NULL; - // frame->width/height lie. Using them breaks with non-mod 16 video. - int w = ctx->avctx->width; - int h = ctx->avctx->height; - handle_preemption(ctx); if (w != p->vid_width || h != p->vid_height || |