summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2023-11-06 13:43:03 +0100
committersfan5 <sfan5@live.de>2023-11-07 16:15:19 +0100
commitff521dfbd115493602f4af2308d958edecae78f0 (patch)
tree3b0740bdf97b90b0f00d5aa4eed3eb7e7cdbda54 /video
parent8c751a0d78492b95c2829e54ae481c1991e9c11e (diff)
downloadmpv-ff521dfbd115493602f4af2308d958edecae78f0.tar.bz2
mpv-ff521dfbd115493602f4af2308d958edecae78f0.tar.xz
vo_gpu_next: drop alpha channel from screenshots if unneeded
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_gpu_next.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c
index dac5eec3a3..299d080c37 100644
--- a/video/out/vo_gpu_next.c
+++ b/video/out/vo_gpu_next.c
@@ -1240,7 +1240,11 @@ static void video_screenshot(struct vo *vo, struct voctrl_screenshot *args)
// Create target FBO, try high bit depth first
int mpfmt;
for (int depth = args->high_bit_depth ? 16 : 8; depth; depth -= 8) {
- mpfmt = depth == 16 ? IMGFMT_RGBA64 : IMGFMT_RGBA;
+ if (depth == 16) {
+ mpfmt = IMGFMT_RGBA64;
+ } else {
+ mpfmt = p->ra_ctx->opts.want_alpha ? IMGFMT_RGBA : IMGFMT_RGB0;
+ }
pl_fmt fmt = pl_find_fmt(gpu, PL_FMT_UNORM, 4, depth, depth,
PL_FMT_CAP_RENDERABLE | PL_FMT_CAP_HOST_READABLE);
if (!fmt)