mirror of https://bitbucket.org/ausocean/av.git
revid: corrected logic for RTMPURL fallback and fixed bug in test
This commit is contained in:
parent
9eb155dfed
commit
d390918209
|
@ -314,8 +314,9 @@ func (c *Config) Validate() error {
|
|||
if c.RTMPURL == "" {
|
||||
c.Logger.Log(logger.Info, pkg+"no RTMP URL: falling back to HTTP")
|
||||
c.Outputs[i] = HTTP
|
||||
break
|
||||
haveRTMPOut = false
|
||||
}
|
||||
fallthrough
|
||||
case HTTP, RTP:
|
||||
if !haveRTMPOut {
|
||||
c.Bitrate = 0
|
||||
|
|
|
@ -53,7 +53,7 @@ func TestValidate(t *testing.T) {
|
|||
},
|
||||
},
|
||||
{
|
||||
in: Config{Outputs: []uint8{RTMP}, Logger: &dumbLogger{}},
|
||||
in: Config{Outputs: []uint8{RTMP}, RTMPURL: "dummURL", Logger: &dumbLogger{}},
|
||||
check: func(c Config) error {
|
||||
if c.Bitrate != defaultBitrate {
|
||||
return fmt.Errorf("did not get expected bitrate. Got: %v, Want: %v", c.Bitrate, defaultBitrate)
|
||||
|
|
Loading…
Reference in New Issue