Merge branch 'master' into adpcm-mts

This commit is contained in:
Trek H 2019-09-14 20:03:30 +09:30
commit bec24b684e
3 changed files with 17 additions and 7 deletions

4
go.mod
View File

@ -3,8 +3,8 @@ module bitbucket.org/ausocean/av
go 1.12
require (
bitbucket.org/ausocean/iot v1.2.6
bitbucket.org/ausocean/utils v1.2.8
bitbucket.org/ausocean/iot v1.2.7
bitbucket.org/ausocean/utils v1.2.9
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/Comcast/gots v0.0.0-20190305015453-8d56e473f0f7
github.com/go-audio/audio v0.0.0-20181013203223-7b2a6ca21480

4
go.sum
View File

@ -2,10 +2,14 @@ bitbucket.org/ausocean/av v0.0.0-20190416003121-6ee286e98874/go.mod h1:DxZEprrNN
bitbucket.org/ausocean/iot v1.2.4/go.mod h1:5HVLgPHccW2PxS7WDUQO6sKWMgk3Vfze/7d5bHs8EWU=
bitbucket.org/ausocean/iot v1.2.6 h1:KAAY1KZDbyOpoKajT1dM8BawupHiW9hUOelseSV1Ptc=
bitbucket.org/ausocean/iot v1.2.6/go.mod h1:71AYHh8yGZ8XyzDBskwIWMF+8E8ORagXpXE24wlhoE0=
bitbucket.org/ausocean/iot v1.2.7 h1:dZgrmVtuXnzHgybDthn0bYgAJms9euTONXBsqsx9g5M=
bitbucket.org/ausocean/iot v1.2.7/go.mod h1:aAWgPo2f8sD2OPmxae1E5/iD9+tKY/iW4pcQMQXUvHM=
bitbucket.org/ausocean/utils v0.0.0-20190408050157-66d3b4d4041e/go.mod h1:uXzX9z3PLemyURTMWRhVI8uLhPX4uuvaaO85v2hcob8=
bitbucket.org/ausocean/utils v1.2.6/go.mod h1:uXzX9z3PLemyURTMWRhVI8uLhPX4uuvaaO85v2hcob8=
bitbucket.org/ausocean/utils v1.2.8 h1:hyxAIqYBqjqCguG+6A/kKyrAihyeUt2LziZg6CH0gLU=
bitbucket.org/ausocean/utils v1.2.8/go.mod h1:uXzX9z3PLemyURTMWRhVI8uLhPX4uuvaaO85v2hcob8=
bitbucket.org/ausocean/utils v1.2.9 h1:g45C6KCNvCLOGFv+ZnmDbQOOdnwpIsvzuNOD141CTVI=
bitbucket.org/ausocean/utils v1.2.9/go.mod h1:uXzX9z3PLemyURTMWRhVI8uLhPX4uuvaaO85v2hcob8=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Comcast/gots v0.0.0-20190305015453-8d56e473f0f7 h1:LdOc9B9Bj6LEsKiXShkLA3/kpxXb6LJpH+ekU2krbzw=

View File

@ -119,10 +119,11 @@ type Revid struct {
// an error if construction of the new instance was not successful.
func New(c Config, ns *netsender.Sender) (*Revid, error) {
r := Revid{ns: ns, err: make(chan error)}
err := r.reset(c)
err := r.setConfig(c)
if err != nil {
return nil, err
return nil, fmt.Errorf("could not set config, failed with error: %v",err)
}
r.config.Logger.SetLevel(c.LogLevel)
go r.handleErrors()
return &r, nil
}
@ -317,12 +318,17 @@ func (r *Revid) Start() error {
}
r.config.Logger.Log(logger.Info, pkg+"starting Revid")
r.isRunning = true
var err error
err := r.reset(r.config)
if err != nil {
r.Stop()
return err
}
r.closeInput, err = r.setupInput()
if err != nil {
r.Stop()
}
return err
}
return nil
}
// Stop closes down the pipeline. This closes encoders and sender output routines,
@ -543,7 +549,7 @@ func (r *Revid) Update(vars map[string]string) error {
}
}
r.config.Logger.Log(logger.Info, pkg+"revid config changed", "config", fmt.Sprintf("%+v", r.config))
return r.reset(r.config)
return nil
}
// startRaspivid sets up things for input from raspivid i.e. starts