Don't SetCodecPreferences for video transceiver (#3249)

The SetCodecPrefrences function will save codecs
to the transceiver and if the primary codec is not
support by the client, the saved codec will generate
rtx codec for the unsupported codec cause corrupted
sdp.
This commit is contained in:
cnderrauber authored and GitHub committed 2024-12-13 21:12:30 +08:00
1 parent 499fbd2a1d
commit 6df339b77c
1 file changed
+6 -2
+6 -2
View File
@@ -811,7 +811,9 @@ func (t *PCTransport) AddTrack(trackLocal webrtc.TrackLocal, params types.AddTra
return
}
configureAudioTransceiver(transceiver, params.Stereo, !params.Red || !t.params.ClientInfo.SupportsAudioRED())
if trackLocal.Kind() == webrtc.RTPCodecTypeAudio {
configureAudioTransceiver(transceiver, params.Stereo, !params.Red || !t.params.ClientInfo.SupportsAudioRED())
}
return
}
@@ -827,7 +829,9 @@ func (t *PCTransport) AddTransceiverFromTrack(trackLocal webrtc.TrackLocal, para
return
}
configureAudioTransceiver(transceiver, params.Stereo, !params.Red || !t.params.ClientInfo.SupportsAudioRED())
if trackLocal.Kind() == webrtc.RTPCodecTypeAudio {
configureAudioTransceiver(transceiver, params.Stereo, !params.Red || !t.params.ClientInfo.SupportsAudioRED())
}
return
}