-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't reuse transceiver in one round negotiation #2899
Conversation
func() { | ||
for _, t := range tracks { | ||
for _, track := range tracks { | ||
func(t *TrackRemote) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Narrow down the scope of the lock
} | ||
case direction == RTPTransceiverDirectionSendrecv: | ||
if t.Direction() == RTPTransceiverDirectionSendonly { | ||
t.setDirection(RTPTransceiverDirectionSendrecv) | ||
} else if t.Direction() == RTPTransceiverDirectionInactive { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transit Inactive
transceiver to RecvOnly
if the remote peer reuse the inactive
transceiver to send track
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2899 +/- ##
==========================================
+ Coverage 78.95% 78.99% +0.04%
==========================================
Files 89 89
Lines 8481 8488 +7
==========================================
+ Hits 6696 6705 +9
+ Misses 1298 1296 -2
Partials 487 487
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -1118,10 +1118,18 @@ func (pc *PeerConnection) SetRemoteDescription(desc SessionDescription) error { | |||
case direction == RTPTransceiverDirectionRecvonly: | |||
if t.Direction() == RTPTransceiverDirectionSendrecv { | |||
t.setDirection(RTPTransceiverDirectionSendonly) | |||
} else if t.Direction() == RTPTransceiverDirectionRecvonly { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set RecvOnly
transceiver to Inactive
if the remote peer stop sending
Should not reuse transceiver (remove & add track) in one round negotiation, it cause the transceiver changes ssrc/id without transit to inactive and the remote peer connection can't fire track close and OnTrack event.
a288d28
to
bc4bdaf
Compare
Should not reuse transceiver (remove & add track) in one round negotiation, it causes the transceiver change ssrc/msid without transit to inactive and the remote peer connection can't fire track close and OnTrack event.
Description
Failure case:
SendRecv
,RecvOny
In step 5, B should not reuse track A's transceiver, otherwise the transceiver in offer and offer2 will not change direction but has different ssrc, cause pcAnwser can't fire OnTrack correctly.
Reference issue
Fixes #...