mirror of
https://github.com/pion/webrtc.git
synced 2025-12-24 11:51:03 +08:00
Fixes for pre-added recvonly transceivers
Which were previously unable to: 1. have a sending track set to them, or 2. receive a track after renegotiation. I'm not 100% sure if this covers all cases where a track is added and removed and then added again. BUT IIRC there was a change that did not allow transceiver reuse after a track was removed from it. Again, not 100% sure. Fixes #1722.
This commit is contained in:
@@ -115,6 +115,12 @@ func (t *RTPTransceiver) setSendingTrack(track TrackLocal) error {
|
||||
t.setDirection(RTPTransceiverDirectionSendonly)
|
||||
case track == nil && t.Direction() == RTPTransceiverDirectionSendrecv:
|
||||
t.setDirection(RTPTransceiverDirectionRecvonly)
|
||||
case track != nil && t.Direction() == RTPTransceiverDirectionSendonly:
|
||||
// Handle the case where a sendonly transceiver was added by a negotiation
|
||||
// initiated by remote peer. For example a remote peer added a transceiver
|
||||
// with direction recvonly.
|
||||
case track != nil && t.Direction() == RTPTransceiverDirectionSendrecv:
|
||||
// Similar to above, but for sendrecv transceiver.
|
||||
case track == nil && t.Direction() == RTPTransceiverDirectionSendonly:
|
||||
t.setDirection(RTPTransceiverDirectionInactive)
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user