revid: use loop in processFrom instead of goto

This commit is contained in:
Saxon 2020-01-24 21:25:27 +10:30
parent 0e14c0a056
commit 64754f7e0f
1 changed files with 20 additions and 24 deletions

View File

@ -859,7 +859,7 @@ func (r *Revid) Update(vars map[string]string) error {
func (r *Revid) processFrom(in device.AVDevice, delay time.Duration) {
defer r.wg.Done()
restart:
for l := true; l; l = r.cfg.Loop {
err := in.Start()
if err != nil {
r.err <- fmt.Errorf("could not start input device: %w", err)
@ -881,10 +881,6 @@ restart:
if err != nil {
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")