Skip to content

Commit

Permalink
SFU id and parse media info before remove request.
Browse files Browse the repository at this point in the history
Former-commit-id: e8e744c
  • Loading branch information
jbrady42 committed May 14, 2020
1 parent 710bcbe commit ff9d6c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/sfu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ func main() {

rpcID := serviceNode.GetRPCChannel()
eventID := serviceNode.GetEventChannel()
sfu.Init(conf.Global.Dc, serviceNode.NodeInfo().ID, rpcID, eventID, conf.Nats.URL)
sfu.Init(conf.Global.Dc, serviceNode.NodeInfo().Info["id"], rpcID, eventID, conf.Nats.URL)
select {}
}
9 changes: 7 additions & 2 deletions pkg/node/sfu/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ func Init(dcID, nodeID, rpcID, eventID, natsURL string) {
func checkRTC() {
log.Infof("SFU.checkRTC start")
go func() {
for mid := range rtc.CleanChannel {
broadcaster.Say(proto.SFUStreamRemove, util.Map("mid", mid))
for mInfo := range rtc.CleanChannel {
mediaInfo, err := proto.ParseMediaInfo(mInfo)
if err != nil {
log.Errorf("Error parsing media info %v", mInfo)
continue
}
broadcaster.Say(proto.SFUStreamRemove, util.Map("mid", mediaInfo.MID))
}
}()
}

0 comments on commit ff9d6c7

Please sign in to comment.