fix: engine should be a ptr

This commit is contained in:
shynome
2023-06-30 15:21:15 +08:00
parent 84efea0028
commit e1f31dc856
3 changed files with 3 additions and 3 deletions

View File

@@ -51,7 +51,7 @@ func (b *Bind) Open(port uint16) (fns []conn.ReceiveFunc, actualPort uint16, err
settingEngine := webrtc.SettingEngine{}
if mux.WithUDPMux != nil {
b.mux = try.To1(mux.WithUDPMux(settingEngine, &port))
b.mux = try.To1(mux.WithUDPMux(&settingEngine, &port))
actualPort = port
}
b.api = webrtc.NewAPI(webrtc.WithSettingEngine(settingEngine))

View File

@@ -5,4 +5,4 @@ import (
"github.com/pion/webrtc/v3"
)
var WithUDPMux func(engine webrtc.SettingEngine, port *uint16) (ice.UDPMux, error)
var WithUDPMux func(engine *webrtc.SettingEngine, port *uint16) (ice.UDPMux, error)

View File

@@ -11,7 +11,7 @@ import (
)
func init() {
WithUDPMux = func(engine webrtc.SettingEngine, port *uint16) (mux ice.UDPMux, err error) {
WithUDPMux = func(engine *webrtc.SettingEngine, port *uint16) (mux ice.UDPMux, err error) {
if err = initPort(port); err != nil {
return
}