Fix response with empty producer

This commit is contained in:
Alexey Khit
2022-08-22 09:06:40 +03:00
parent 67522dbb19
commit f36851f83a
7 changed files with 34 additions and 13 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package streams
import (
"encoding/json"
"errors"
"github.com/AlexxIT/go2rtc/pkg/streamer"
)
@@ -78,7 +79,7 @@ func (s *Stream) AddConsumer(cons streamer.Consumer) (err error) {
// can't match tracks for consumer
if len(consumer.tracks) == 0 {
return nil
return errors.New("couldn't find the matching tracks")
}
s.consumers = append(s.consumers, consumer)