Skip to content

Commit

Permalink
fix typo on callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohan Totting committed Nov 17, 2023
1 parent b0806a9 commit 8d006d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func NewClient(s *SFU, id string, name string, peerConnectionConfig webrtc.Confi
congestionController, err := cc.NewInterceptor(func() (cc.BandwidthEstimator, error) {
// if bw below 100_000, somehow the estimator will struggle to probe the bandwidth and will stuck there. So we set the min to 100_000
// TODO: we need to use packet loss based bandwidth adjuster when the bandwidth is below 100_000
return gcc.NewSendSideBWE(gcc.SendSideBWEInitialBitrate(int(s.bitratesConfig.InitialBandwidth)), gcc.SendSideBWEMinBitrate(100_000))
return gcc.NewSendSideBWE(gcc.SendSideBWEInitialBitrate(int(s.bitratesConfig.InitialBandwidth)))
})
if err != nil {
panic(err)
Expand Down Expand Up @@ -253,9 +253,6 @@ func NewClient(s *SFU, id string, name string, peerConnectionConfig webrtc.Confi
panic(err)
}

// add other clients tracks before generate the answer
// s.addOtherClientTracksBeforeSendAnswer(peerConnection)

var stateNew atomic.Value
stateNew.Store(ClientStateNew)

Expand Down
4 changes: 2 additions & 2 deletions examples/http-websocket/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ func main() {
defer cancel()

sfuOpts := sfu.DefaultOptions()
sfuOpts.EnableMux = true
sfuOpts.EnableBandwidthEstimator = true
sfuOpts.EnableMux = false
sfuOpts.EnableBandwidthEstimator = false

_, turnEnabled := os.LookupEnv("TURN_ENABLED")
if turnEnabled {
Expand Down
8 changes: 4 additions & 4 deletions sfu.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ func DefaultBitrates() BitratesConfig {
return BitratesConfig{
AudioRed: 48_000 * 3,
Audio: 48_000,
Video: 1_500_000,
VideoHigh: 1_500_000,
Video: 1_200_000,
VideoHigh: 1_200_000,
VideoHighPixels: 720,
VideoMid: 500_000,
VideoMidPixels: 360,
VideoLow: 150_000,
VideoLowPixels: 180,
InitialBandwidth: 1_500_000,
InitialBandwidth: 1_000_000,
}
}

Expand Down Expand Up @@ -383,7 +383,7 @@ func (s *SFU) onClientAdded(client *Client) {
}

func (s *SFU) onClientRemoved(client *Client) {
for _, callback := range s.onClientAddedCallbacks {
for _, callback := range s.onClientRemovedCallbacks {
callback(client)
}
}
Expand Down

0 comments on commit 8d006d9

Please sign in to comment.