mirror of
https://github.com/mpv-player/mpv
synced 2025-01-24 16:43:28 +00:00
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.)
This commit is contained in:
parent
3fc3bf70f9
commit
df9639d755
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user