Do not force codec regression between opus and red. (#3980)

The following scenario produced silence audio in egress
1. JS SDK publishing audio/red
2. Egress joins
3. Egress picks the RED primary receiver -> this converts RED to Opus in SFU
4. At the same time, codec regression is triggered back to the publisher. Publisher switches to publishing audio/opus and stops audio/red.
5. But, egress is still attached to audio/red and pulls down only silence.

Fix by checking if the negotiated codec needs publish before sending
subscribed codec udpate.
This commit is contained in:
Raja Subramanian
2025-10-04 00:17:17 +05:30
committed by GitHub
parent 3bd20ddb28
commit c7f625d626
2 changed files with 14 additions and 5 deletions
+1 -1
View File
@@ -433,7 +433,7 @@ func (t *SubscribedTrack) OnRttUpdate(rtt uint32) {
}
func (t *SubscribedTrack) OnCodecNegotiated(codec webrtc.RTPCodecCapability) {
if !t.params.WrappedReceiver.DetermineReceiver(codec) {
if isAvailable, needsPublish := t.params.WrappedReceiver.DetermineReceiver(codec); !isAvailable || !needsPublish {
return
}