mirror of https://bitbucket.org/ausocean/av.git
revid/config/config.go: checking WriteRate as we need that for encoders
This commit is contained in:
parent
cf130de752
commit
527472e934
|
@ -71,7 +71,6 @@ const (
|
|||
// General revid defaults.
|
||||
defaultInput = InputRaspivid
|
||||
defaultOutput = OutputHTTP
|
||||
defaultWriteRate = 25
|
||||
defaultTimeout = 0
|
||||
defaultInputCodec = codecutil.H264
|
||||
defaultVerbosity = logger.Error
|
||||
|
@ -80,6 +79,7 @@ const (
|
|||
defaultBurstPeriod = 10 // Seconds
|
||||
defaultMinFrames = 100
|
||||
defaultFrameRate = 25
|
||||
defaultWriteRate = 25
|
||||
defaultClipDuration = 0
|
||||
defaultAudioInputCodec = codecutil.ADPCM
|
||||
|
||||
|
@ -335,11 +335,14 @@ func (c *Config) Validate() error {
|
|||
return errors.New("refresh period is less than 0")
|
||||
}
|
||||
|
||||
if c.FrameRate == 0 {
|
||||
c.Logger.Log(logger.Info, pkg+"no frame rate defined, defaulting", "FrameRate", defaultFrameRate)
|
||||
if c.FrameRate <= 0 {
|
||||
c.Logger.Log(logger.Info, pkg+"frame rate bad or unset, defaulting", "FrameRate", defaultFrameRate)
|
||||
c.FrameRate = defaultFrameRate
|
||||
} else if c.FrameRate < 0 {
|
||||
return errors.New("frame rate less than 0")
|
||||
}
|
||||
|
||||
if c.WriteRate <= 0 {
|
||||
c.Logger.Log(logger.Info, pkg+"write rate bad or unset, defaulting", "writeRate", defaultWriteRate)
|
||||
c.WriteRate = defaultWriteRate
|
||||
}
|
||||
|
||||
if c.ClipDuration == 0 {
|
||||
|
|
Loading…
Reference in New Issue