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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user