[client] overlay: limit splash fade to startup

The splash state machine reset its fade whenever a transport handoff
restored the logo. Each replacement source therefore started another
one-second fade when it became ready.

Retain one startup fade allowance and consume it on the first hide.
Later source changes can still show the unavailable-video splash, but
hide it immediately when video returns.
This commit is contained in:
Geoffrey McRae
2026-08-16 02:59:03 +10:00
parent 358171ff8b
commit 20b2225c69

View File

@@ -51,6 +51,7 @@ enum SplashState
static _Atomic(bool) l_requestedShow; static _Atomic(bool) l_requestedShow;
static _Atomic(bool) l_fading; static _Atomic(bool) l_fading;
static bool l_appliedShow; static bool l_appliedShow;
static bool l_startupFadePending;
static enum SplashState l_state; static enum SplashState l_state;
static uint64_t l_fadeStart; static uint64_t l_fadeStart;
static OverlayImage l_logo; static OverlayImage l_logo;
@@ -103,6 +104,7 @@ static bool splash_init(void ** udata, const void * params)
atomic_store_explicit(&l_requestedShow, show, memory_order_relaxed); atomic_store_explicit(&l_requestedShow, show, memory_order_relaxed);
atomic_store_explicit(&l_fading, false, memory_order_relaxed); atomic_store_explicit(&l_fading, false, memory_order_relaxed);
l_appliedShow = show; l_appliedShow = show;
l_startupFadePending = show;
l_state = show ? SPLASH_VISIBLE : SPLASH_HIDDEN; l_state = show ? SPLASH_VISIBLE : SPLASH_HIDDEN;
l_fadeStart = 0; l_fadeStart = 0;
@@ -273,13 +275,15 @@ static bool splash_needsFullRender(void * udata)
l_fadeStart = 0; l_fadeStart = 0;
atomic_store_explicit(&l_fading, false, memory_order_release); atomic_store_explicit(&l_fading, false, memory_order_release);
} }
else if (g_params.quickSplash) else if (g_params.quickSplash || !l_startupFadePending)
{ {
l_startupFadePending = false;
l_state = SPLASH_HIDDEN; l_state = SPLASH_HIDDEN;
atomic_store_explicit(&l_fading, false, memory_order_release); atomic_store_explicit(&l_fading, false, memory_order_release);
} }
else else
{ {
l_startupFadePending = false;
l_state = SPLASH_FADING; l_state = SPLASH_FADING;
l_fadeStart = nanotime(); l_fadeStart = nanotime();
atomic_store_explicit(&l_fading, true, memory_order_release); atomic_store_explicit(&l_fading, true, memory_order_release);