From 4fef2097ce608dd8a2f0a2a8e925ff423a17f941 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 26 Aug 2013 10:09:27 +0200 Subject: gl_video: fix odd video sizes with PBOs Odd video sizes if pixel formats with chroma subsampling and PBOs were used, garbage was rendered. This was because the PBO path created buffers with an unpadded size, and then tried to upload a padded image to it. Fix it by explicitly setting the padded size. (As with the non-PBO path, we rely that image allocations are somehow padded, which is normally the case.) --- video/out/gl_video.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 6fb41e5814..7cce15e884 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1499,6 +1499,10 @@ static bool get_image(struct gl_video *p, struct mp_image *mpi) struct video_image *vimg = &p->image; + // See comments in init_video() about odd video sizes. + // The normal upload path does this too, but less explicit. + mp_image_set_size(mpi, vimg->planes[0].w, vimg->planes[0].h); + for (int n = 0; n < p->plane_count; n++) { struct texplane *plane = &vimg->planes[n]; mpi->stride[n] = mpi->plane_w[n] * p->image_desc.bytes[n]; -- cgit v1.2.3