[client/idd] network: discard stale audio after stalls

Keep PCM and its clock sample in cancellable datagrams so recovery
cannot replay audio buffered before a Wi-Fi stall.

Drop blocked real-time packets with an explicit discontinuity and make
a newer reconnect supersede stale audio authorities.
This commit is contained in:
Geoffrey McRae
2026-10-08 22:51:47 +11:00
parent b1dda92f09
commit 0b0f227c08
11 changed files with 341 additions and 700 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -4747,13 +4747,18 @@ retry:
HandshakeState handshake;
uint64_t sessionEpoch;
uint32_t maxPayload;
bool closing;
{
CSRWSharedLock guard(connection.lock);
handshake = connection.handshake;
sessionEpoch = connection.sessionEpoch;
maxPayload = connection.maxPayload;
closing = connection.closing;
}
if (closing)
return true;
if (handshake == HandshakeState::WAITING_HELLO)
return packet.envelope.service == LG_NET_SERVICE_CORE &&
packet.envelope.messageType == LG_NET_CORE_MESSAGE_HELLO &&
@@ -5188,6 +5193,8 @@ retry:
const uint16_t serviceMask = UINT16_C(1) << packet.envelope.service;
{
CSRWExclusiveLock guard(connection.lock);
if (connection.closing)
return true;
const bool serviceReady = packet.envelope.service ==
LG_NET_SERVICE_CORE ||
((connection.selectedServices & serviceMask) &&