summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-15 18:20:15 +0200
committerwm4 <wm4@nowhere>2013-08-15 23:40:02 +0200
commit0da96385765840c418a789d06ec66c918b59d7ce (patch)
treed7ae53619256e17f9a7c901046af9dffc52786a6 /video/decode/vd_lavc.c
parent30f2db5930993184e125aa5ee46c73002f5de745 (diff)
downloadmpv-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/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c6
1 files changed, 5 insertions, 1 deletions
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++)