Update error msg for fail codecs negotiation
This commit is contained in:
@@ -3,6 +3,7 @@ package streams
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"github.com/AlexxIT/go2rtc/pkg/streamer"
|
"github.com/AlexxIT/go2rtc/pkg/streamer"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -98,7 +99,11 @@ func (s *Stream) AddConsumer(cons streamer.Consumer) (err error) {
|
|||||||
|
|
||||||
if len(producers) == 0 {
|
if len(producers) == 0 {
|
||||||
s.stopProducers()
|
s.stopProducers()
|
||||||
return errors.New("no matching codecs: " + codecs)
|
if len(codecs) > 0 {
|
||||||
|
return errors.New("codecs not match: " + codecs)
|
||||||
|
} else {
|
||||||
|
return fmt.Errorf("sources unavailable: %d", len(s.producers))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
|
|||||||
Reference in New Issue
Block a user