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

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);
if (atomic_load_explicit(&fallback->stop, memory_order_acquire))
break;
if (!sessionLive(fallback))
{
lost = !atomic_load_explicit(
&fallback->stop, memory_order_acquire);
break;
}
applyVideoRequest(fallback);
LG_LOCK_EXCLUSIVE(fallback->lock);
@@ -695,12 +703,14 @@ static bool applyVideoRequest(LG_TransportFallback * fallback)
};
const bool result = lgSwSurface_setActive(surfaceOps, transport,
requested, videoCallCancelled, (void *)&cancellation);
const bool live = sessionLive(fallback);
LG_LOCK_EXCLUSIVE(fallback->lock);
const bool current = fallback->connectionSerial == connectionSerial;
const bool current = fallback->connectionSerial ==
connectionSerial;
const bool desiredCurrent = current &&
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->stop, memory_order_acquire) &&
!fallback->closing && endpointMatchesLocked(fallback);
@@ -717,7 +727,7 @@ static bool applyVideoRequest(LG_TransportFallback * fallback)
ready, memory_order_release);
}
const bool accepted = usable;
const bool retry = current && !fallback->closing &&
const bool retry = current && !fallback->closing &&
fallback->videoRequested != requested;
LG_UNLOCK_EXCLUSIVE(fallback->lock);