mirror of https://bitbucket.org/ausocean/av.git
revid: use loop in processFrom instead of goto
This commit is contained in:
parent
0e14c0a056
commit
64754f7e0f
|
@ -859,7 +859,7 @@ func (r *Revid) Update(vars map[string]string) error {
|
||||||
func (r *Revid) processFrom(in device.AVDevice, delay time.Duration) {
|
func (r *Revid) processFrom(in device.AVDevice, delay time.Duration) {
|
||||||
defer r.wg.Done()
|
defer r.wg.Done()
|
||||||
|
|
||||||
restart:
|
for l := true; l; l = r.cfg.Loop {
|
||||||
err := in.Start()
|
err := in.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.err <- fmt.Errorf("could not start input device: %w", err)
|
r.err <- fmt.Errorf("could not start input device: %w", err)
|
||||||
|
@ -881,10 +881,6 @@ restart:
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.err <- fmt.Errorf("could not stop input source: %w", err)
|
r.err <- fmt.Errorf("could not stop input source: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.cfg.Loop {
|
|
||||||
r.cfg.Logger.Log(logger.Info, pkg+"looping input")
|
|
||||||
goto restart
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r.cfg.Logger.Log(logger.Info, pkg+"finished lexing")
|
r.cfg.Logger.Log(logger.Info, pkg+"finished lexing")
|
||||||
|
|
Loading…
Reference in New Issue