From a8146e7cbb63b9277ef019be1576d64aa776cc84 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sat, 10 Oct 2020 13:50:37 +0200 Subject: [PATCH] Setting blocking option to 0, fix #11 --- stream/srt/srt.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/stream/srt/srt.go b/stream/srt/srt.go index 2467d82..916441a 100644 --- a/stream/srt/srt.go +++ b/stream/srt/srt.go @@ -66,7 +66,11 @@ func Serve(cfg *Options, authBackend auth.Backend, forwardingChannel, webrtcChan if err != nil { log.Fatalf("Failed to split host and port from %s", cfg.ListenAddress) } - sck := srtgo.NewSrtSocket(host, port, nil) + + options := make(map[string]string) + options["blocking"] = "0" + options["transtype"] = "live" + sck := srtgo.NewSrtSocket(host, port, options) if err := sck.Listen(cfg.MaxClients); err != nil { log.Fatal("Unable to listen for SRT clients:", err) } @@ -77,7 +81,8 @@ func Serve(cfg *Options, authBackend auth.Backend, forwardingChannel, webrtcChan // Wait for new connection s, err := sck.Accept() if err != nil { - // Something wrong happenned + // Something wrong happened + log.Println(err) continue }