Skip to content

Commit

Permalink
Separate close and stop on MediaTrackSubscriptions. (livekit#823)
Browse files Browse the repository at this point in the history
  • Loading branch information
boks1971 authored Jul 9, 2022
1 parent 1e71343 commit 01f7309
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/rtc/mediatrackreceiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (t *MediaTrackReceiver) Close() {
onclose := t.onClose
t.lock.RUnlock()

t.MediaTrackSubscriptions.Stop()
t.MediaTrackSubscriptions.Close()
for _, f := range onclose {
f()
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/rtc/mediatracksubscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ func (t *MediaTrackSubscriptions) Restart() {
}

func (t *MediaTrackSubscriptions) Stop() {
t.stopMaxQualityTimer()
}

func (t *MediaTrackSubscriptions) Close() {
t.qualityNotifyOpQueue.Stop()
t.stopMaxQualityTimer()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/rtc/participant.go
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,7 @@ func (p *ParticipantImpl) mediaTrackReceived(track *webrtc.TrackRemote, rtpRecei
p.pendingTracksLock.Lock()
newTrack := false

p.params.Logger.Debugw("media track received", "track", track.ID(), "kind", track.Kind())
p.params.Logger.Debugw("media track received", "trackID", track.ID(), "kind", track.Kind())
var mid string
for _, tr := range p.publisher.pc.GetTransceivers() {
if tr.Receiver() == rtpReceiver {
Expand Down

0 comments on commit 01f7309

Please sign in to comment.