summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-15 18:20:52 +0200
committerwm4 <wm4@nowhere>2013-08-15 23:40:02 +0200
commitbe2f2ff033620b31fe04cf53f2b745ebfb2e0ffc (patch)
tree2dd7b05673fb4f5c197d7d73b064f3f2bec71f2c /video
parent0da96385765840c418a789d06ec66c918b59d7ce (diff)
downloadmpv-be2f2ff033620b31fe04cf53f2b745ebfb2e0ffc.tar.bz2
mpv-be2f2ff033620b31fe04cf53f2b745ebfb2e0ffc.tar.xz
vd_lavc: fix comment, document hwdec video frame size trickiness
About this issue, it would be better if the surfaces could be allocated with the real size, and the vdpau video mixer could be created with that size as well. That would be a bit hard, because the real surface size had to be communicated to vdpau. So I'm going with this solution. vaapi seems to be fine with either surface size, so there's hopefully no problem.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index c899e53206..ba9b81d98e 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -565,7 +565,10 @@ static struct mp_image *get_surface_hwdec(struct sh_video *sh, AVFrame *pic)
if (!IMGFMT_IS_HWACCEL(imgfmt))
return NULL;
- // frame->width/height lie. Using them breaks with non-mod 16 video.
+ // Using frame->width/height is bad. For non-mod 16 video (which would
+ // require alignment of frame sizes) we want the decoded size, not the
+ // aligned size. At least vdpau needs this: the video mixer is created
+ // with decoded size, and the video surfaces must have matching size.
int w = ctx->avctx->width;
int h = ctx->avctx->height;