move stop timer in mediatracksubscriptions module where it belongs (#357)
* move stop timer in mediatracksubscriptions module where it belongs * Correct my screw up
This commit is contained in:
@@ -202,7 +202,6 @@ func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track *webrtc.Tra
|
|||||||
)
|
)
|
||||||
wr.SetRTCPCh(t.params.RTCPChan)
|
wr.SetRTCPCh(t.params.RTCPChan)
|
||||||
wr.OnCloseHandler(func() {
|
wr.OnCloseHandler(func() {
|
||||||
t.stopMaxQualityTimer()
|
|
||||||
t.RemoveAllSubscribers()
|
t.RemoveAllSubscribers()
|
||||||
t.MediaTrackReceiver.Close()
|
t.MediaTrackReceiver.Close()
|
||||||
t.params.Telemetry.TrackUnpublished(context.Background(), t.PublisherID(), t.ToProto(), uint32(track.SSRC()))
|
t.params.Telemetry.TrackUnpublished(context.Background(), t.PublisherID(), t.ToProto(), uint32(track.SSRC()))
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ func (t *MediaTrackReceiver) Close() {
|
|||||||
onclose := t.onClose
|
onclose := t.onClose
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
|
|
||||||
|
t.MediaTrackSubscriptions.Close()
|
||||||
|
|
||||||
for _, f := range onclose {
|
for _, f := range onclose {
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ func NewMediaTrackSubscriptions(params MediaTrackSubscriptionsParams) *MediaTrac
|
|||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *MediaTrackSubscriptions) Close() {
|
||||||
|
t.stopMaxQualityTimer()
|
||||||
|
}
|
||||||
|
|
||||||
func (t *MediaTrackSubscriptions) OnNoSubscribers(f func()) {
|
func (t *MediaTrackSubscriptions) OnNoSubscribers(f func()) {
|
||||||
t.onNoSubscribers = f
|
t.onNoSubscribers = f
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user