From 792f8473ee2799bae64b1536d58cd52c855b12d6 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Tue, 24 Jan 2023 08:12:47 -0800 Subject: [PATCH] libobs: Fix SDR async video on non-SDR targets Bug was seen when projecting SDR video capture on WCG displays. --- libobs/obs-source.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 30212699f..39c555020 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -2478,6 +2478,8 @@ static inline void obs_source_render_async_video(obs_source_t *source) bool nonlinear_alpha = false; switch (source_space) { case GS_CS_SRGB: + linear_srgb = linear_srgb || + (current_space != GS_CS_SRGB); nonlinear_alpha = linear_srgb && !source->async_linear_alpha; switch (current_space) { @@ -2492,7 +2494,6 @@ static inline void obs_source_render_async_video(obs_source_t *source) nonlinear_alpha ? "DrawNonlinearAlphaMultiply" : "DrawMultiply"; - linear_srgb = true; multiplier = obs_get_video_sdr_white_level() / 80.0f; }