mirror of https://bitbucket.org/ausocean/av.git
audio: codec config validation
This commit is contained in:
parent
95fc69b3c5
commit
d48a11794b
|
@ -189,9 +189,8 @@ func validate(c *Config) error {
|
||||||
if c.RecPeriod <= 0 {
|
if c.RecPeriod <= 0 {
|
||||||
return fmt.Errorf("invalid recording period: %v", c.RecPeriod)
|
return fmt.Errorf("invalid recording period: %v", c.RecPeriod)
|
||||||
}
|
}
|
||||||
err := codecutil.Validate(c.Codec)
|
if !codecutil.IsValid(c.Codec) {
|
||||||
if err != nil {
|
return errors.New("invalid codec")
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue