fix: skip TCP-tunneled audio when UDP is active to prevent double-processing

When UDP audio transport is active, ignore UDPTunnel packets (type 1)
on the TCP connection. Without this, audio packets arrive via both
TCP and UDP, causing the per-user sequence tracker to advance by 2
per frame. The gap detection then generates spurious PLC frames for
every single audio packet, producing log spam and audio artifacts.

The readRoutine now checks c.udpActive before dispatching packet
type 1.
This commit is contained in:
Brandon McGinty (deepseek)
2026-08-08 22:42:18 -04:00
committed by Brandon McGinty
parent 0ecdbf988f
commit 5984989ea7
+5
View File
@@ -252,6 +252,11 @@ func (c *Client) readRoutine() {
if err != nil {
break
}
// When UDP audio is active, ignore TCP-tunneled audio
// (packet type 1) to avoid double-processing packets.
if pType == 1 && c.udpActive {
continue
}
if int(pType) < len(handlers) {
handlers[pType](c, data)
}