Add an error return to makeStreamID to make issues explicit (#400)

* Add an error return to makeStreamID to make issues explicit

* Reinstate nil check
This commit is contained in:
Thom Shutt
2024-05-28 08:02:57 +01:00
committed by GitHub
parent 11a5584d69
commit 343a3ddb37
5 changed files with 27 additions and 27 deletions
+2 -2
View File
@@ -77,9 +77,9 @@ func main() {
lpms.HandleRTMPPublish(
//makeStreamID (give the stream an ID)
func(url *url.URL) stream.AppData {
func(url *url.URL) (stream.AppData, error) {
s := exampleStream(randString(10))
return &s
return &s, nil
},
//gotStream
+2 -2
View File
@@ -40,9 +40,9 @@ func main() {
lpms := core.New(&core.LPMSOpts{WorkDir: fmt.Sprintf("%v/.tmp", dir)})
lpms.HandleRTMPPublish(
func(url *url.URL) stream.AppData {
func(url *url.URL) (stream.AppData, error) {
glog.Infof("Stream has been started!: %v", url)
return exampleStream(randString(10))
return exampleStream(randString(10)), nil
},
func(url *url.URL, rs stream.RTMPVideoStream) (err error) {