[client] spice: terminate fallback after MAIN loss
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / idd (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run

Treat a missing SPICE MAIN channel as terminal in PureSpice.

Check fallback session health before activation and publication.
This commit is contained in:
Geoffrey McRae
2026-08-21 20:36:36 +10:00
parent 53917c4918
commit 7476e56ded
2 changed files with 14 additions and 4 deletions

View File

@@ -460,6 +460,14 @@ static LG_TransportStatus connectFallback(LG_TransportFallback * fallback,
lgWaitEvent(fallback->wakeEvent, SESSION_POLL_MS); lgWaitEvent(fallback->wakeEvent, SESSION_POLL_MS);
if (atomic_load_explicit(&fallback->stop, memory_order_acquire)) if (atomic_load_explicit(&fallback->stop, memory_order_acquire))
break; break;
if (!sessionLive(fallback))
{
lost = !atomic_load_explicit(
&fallback->stop, memory_order_acquire);
break;
}
applyVideoRequest(fallback); applyVideoRequest(fallback);
LG_LOCK_EXCLUSIVE(fallback->lock); LG_LOCK_EXCLUSIVE(fallback->lock);
@@ -695,12 +703,14 @@ static bool applyVideoRequest(LG_TransportFallback * fallback)
}; };
const bool result = lgSwSurface_setActive(surfaceOps, transport, const bool result = lgSwSurface_setActive(surfaceOps, transport,
requested, videoCallCancelled, (void *)&cancellation); requested, videoCallCancelled, (void *)&cancellation);
const bool live = sessionLive(fallback);
LG_LOCK_EXCLUSIVE(fallback->lock); LG_LOCK_EXCLUSIVE(fallback->lock);
const bool current = fallback->connectionSerial == connectionSerial; const bool current = fallback->connectionSerial ==
connectionSerial;
const bool desiredCurrent = current && const bool desiredCurrent = current &&
fallback->videoRequested == requested; fallback->videoRequested == requested;
const bool usable = desiredCurrent && result && const bool usable = desiredCurrent && result && live &&
atomic_load_explicit(&fallback->usable, memory_order_acquire) && atomic_load_explicit(&fallback->usable, memory_order_acquire) &&
!atomic_load_explicit(&fallback->stop, memory_order_acquire) && !atomic_load_explicit(&fallback->stop, memory_order_acquire) &&
!fallback->closing && endpointMatchesLocked(fallback); !fallback->closing && endpointMatchesLocked(fallback);