audio: codec config validation

This commit is contained in:
Trek H 2019-06-20 18:29:08 +09:30
parent 95fc69b3c5
commit d48a11794b
1 changed files with 2 additions and 3 deletions

View File

@ -189,9 +189,8 @@ func validate(c *Config) error {
if c.RecPeriod <= 0 {
return fmt.Errorf("invalid recording period: %v", c.RecPeriod)
}
err := codecutil.Validate(c.Codec)
if err != nil {
return err
if !codecutil.IsValid(c.Codec) {
return errors.New("invalid codec")
}
return nil
}