From 9252ff4ce1d14f8347f85546b04fedb2d348d8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 10 Oct 2025 05:45:10 +0200 Subject: [PATCH] player/playloop: set consistent video parameters in idle mode Prefer RGBA if available to avoid configuring color conversion that wouldn't be used anyway. And set sRGB primaries, just for consistency. --- player/playloop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/player/playloop.c b/player/playloop.c index f4d8a0b50f..fe345bc338 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -1063,7 +1063,9 @@ int handle_force_window(struct MPContext *mpctx, bool force) int config_format = 0; uint8_t fmts[IMGFMT_END - IMGFMT_START] = {0}; vo_query_formats(vo, fmts); - for (int fmt = IMGFMT_START; fmt < IMGFMT_END; fmt++) { + if (fmts[IMGFMT_RGBA - IMGFMT_START]) + config_format = IMGFMT_RGBA; + for (int fmt = IMGFMT_START; fmt < IMGFMT_END && !config_format; fmt++) { if (fmts[fmt - IMGFMT_START]) { config_format = fmt; break; @@ -1080,7 +1082,9 @@ int handle_force_window(struct MPContext *mpctx, bool force) .w = w, .h = h, .p_w = 1, .p_h = 1, .force_window = true, + .color = pl_color_space_srgb, }; + mp_image_params_guess_csp(&p); if (vo_reconfig(vo, &p) < 0) goto err; struct track *track = mpctx->current_track[0][STREAM_VIDEO];