remove all forwarders when source track is closed

This commit is contained in:
David Zhao
2020-12-04 23:28:50 -08:00
parent c401a6fdab
commit 0dcfffb9d8
4 changed files with 26 additions and 5 deletions
+4
View File
@@ -100,6 +100,10 @@ func (r *Receiver) Stats() (sfu.BufferStats, rtcp.ReceptionReport) {
return r.buffer.Stats(), r.buffer.BuildReceptionReport()
}
func (r *Receiver) OnClose(onclose func(r *Receiver)) {
r.onCloseHandler = onclose
}
// rtpWorker reads RTP stream, fills buffer and channel
func (r *Receiver) rtpWorker() {
defer func() {