From 6ecce76602e7bb97f77f9e5688b452b8edb5a391 Mon Sep 17 00:00:00 2001 From: Trek H Date: Fri, 14 Aug 2020 12:20:51 +0930 Subject: [PATCH 1/3] revid: improve comments --- go.sum | 1 + revid/revid.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/go.sum b/go.sum index 0537db2b..5b5ce051 100644 --- a/go.sum +++ b/go.sum @@ -66,6 +66,7 @@ golang.org/x/image v0.0.0-20200119044424-58c23975cae1 h1:5h3ngYt7+vXCDZCup/HkCQg golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/sys v0.0.0-20190913121621-c3b328c6e5a7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/revid/revid.go b/revid/revid.go index 41b83602..23f8cd68 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -455,7 +455,7 @@ func (r *Revid) Start() error { } r.cfg.Logger.Log(logger.Info, "revid reset") - // Calculate delay between frames based on FileFPS for Video or + // Calculate delay between frames based on FileFPS for video or // between recording periods for audio. d := time.Duration(0) if r.cfg.Input == config.InputAudio { From 7cf449b5c9944bbc5323632f33a5a8d743e2668e Mon Sep 17 00:00:00 2001 From: Trek H Date: Fri, 14 Aug 2020 12:34:20 +0930 Subject: [PATCH 2/3] revid: simplify --- revid/revid.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index 23f8cd68..1952f889 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -459,11 +459,9 @@ func (r *Revid) Start() error { // between recording periods for audio. d := time.Duration(0) if r.cfg.Input == config.InputAudio { - if r.cfg.RecPeriod != 0 { d = time.Duration(r.cfg.RecPeriod * float64(time.Second)) } - } else { - if r.cfg.FileFPS != 0 { + } else if r.cfg.FileFPS != 0 { d = time.Duration(1000/r.cfg.FileFPS) * time.Millisecond } } From 3ec7eddfedfc7d6cf3c9798036ef65401322d1c8 Mon Sep 17 00:00:00 2001 From: Trek H Date: Fri, 14 Aug 2020 12:54:07 +0930 Subject: [PATCH 3/3] revid: syntax --- revid/revid.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index 1952f889..e28b44ca 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -459,11 +459,9 @@ func (r *Revid) Start() error { // between recording periods for audio. d := time.Duration(0) if r.cfg.Input == config.InputAudio { - d = time.Duration(r.cfg.RecPeriod * float64(time.Second)) - } + d = time.Duration(r.cfg.RecPeriod * float64(time.Second)) } else if r.cfg.FileFPS != 0 { - d = time.Duration(1000/r.cfg.FileFPS) * time.Millisecond - } + d = time.Duration(1000/r.cfg.FileFPS) * time.Millisecond } r.cfg.Logger.Log(logger.Debug, "starting input processing routine")