summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-26 10:09:27 +0200
committerwm4 <wm4@nowhere>2013-08-29 19:20:05 +0200
commit4fef2097ce608dd8a2f0a2a8e925ff423a17f941 (patch)
treeab1675cb0603b2dbf1549ead8b626a399e33678a
parent669f5d42f0a729655567fa0a6a353e68a56c16fb (diff)
downloadmpv-4fef2097ce608dd8a2f0a2a8e925ff423a17f941.tar.bz2
mpv-4fef2097ce608dd8a2f0a2a8e925ff423a17f941.tar.xz
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.)
-rw-r--r--video/out/gl_video.c4
1 files changed, 4 insertions, 0 deletions
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];