diff options
author | Niklas Haas <git@haasn.dev> | 2022-09-12 15:25:56 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2022-09-12 15:25:56 +0200 |
commit | 7a6dc79e29b9a602cf668e6ff20a92207ec93223 (patch) | |
tree | b30c73775ac228e4857286a69a31f2b50a081bfa | |
parent | 38a7562ebe6b5276fd7282e5736b6525044501a9 (diff) | |
download | mpv-7a6dc79e29b9a602cf668e6ff20a92207ec93223.tar.bz2 mpv-7a6dc79e29b9a602cf668e6ff20a92207ec93223.tar.xz |
vo_gpu_next: use correct pixel size when mapping formats
`total_bits` may be less than the true pixel stride (`bpp`) for formats
which contain extra ignored components (e.g. rgb0).
-rw-r--r-- | video/out/vo_gpu_next.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index c1e8302402..bd0eb4ce84 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -401,7 +401,7 @@ static int plane_data_from_imgfmt(struct pl_plane_data out_data[4], if (total_bits % 8) return 0; // pixel size is not byte-aligned - data->pixel_stride = total_bits / 8; + data->pixel_stride = desc.bpp[p] / 8; data->type = (desc.flags & MP_IMGFLAG_TYPE_FLOAT) ? PL_FMT_FLOAT : PL_FMT_UNORM; |