summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2022-09-12 15:58:13 +0200
committerNiklas Haas <git@haasn.dev>2022-09-12 16:01:07 +0200
commitb9c7e5b5fff88c86ed19c9753b3b8a2499293bee (patch)
tree86a558cadf6222ada954ad39251714cf8687af6a
parent30ca46259e574b2c311a2211948d849441e1ac4d (diff)
downloadmpv-b9c7e5b5fff88c86ed19c9753b3b8a2499293bee.tar.bz2
mpv-b9c7e5b5fff88c86ed19c9753b3b8a2499293bee.tar.xz
vo_gpu_next: only require full pixel byte alignment
The current code also rejects e.g. rgb30, even though this format is perfectly valid, because it only checks for alignment of the used bits.
-rw-r--r--video/out/vo_gpu_next.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index 776fdf49cd..d5b85411c0 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -348,6 +348,9 @@ static int plane_data_from_imgfmt(struct pl_plane_data out_data[4],
struct pl_plane_data *data = &out_data[p];
struct mp_imgfmt_comp_desc sorted[MP_NUM_COMPONENTS];
int num_comps = 0;
+ if (desc.bpp[p] % 8)
+ return 0; // Pixel size is not byte-aligned
+
for (int c = 0; c < mp_imgfmt_desc_get_num_comps(&desc); c++) {
if (desc.comps[c].plane != p)
continue;
@@ -398,9 +401,6 @@ 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 = desc.bpp[p] / 8;
data->type = (desc.flags & MP_IMGFLAG_TYPE_FLOAT)
? PL_FMT_FLOAT