mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-29 15:11:09 +08: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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user