diff options
author | wm4 <wm4@nowhere> | 2013-08-26 10:09:27 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-08-26 10:09:46 +0200 |
commit | df9639d755448380d0caec144a7e822bb100078e (patch) | |
tree | 37ef3502b7de63f3561faa550e215d1bc2fcff84 /video | |
parent | 3fc3bf70f972f4e68258193f0f9c70ee6b85be5e (diff) | |
download | mpv-df9639d755448380d0caec144a7e822bb100078e.tar.bz2 mpv-df9639d755448380d0caec144a7e822bb100078e.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.)
Diffstat (limited to 'video')
-rw-r--r-- | video/out/gl_video.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index e285be252a..f6708694e5 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]; |