From 9ba72fac629ce7c2a2ab947cdae1698ef69fd804 Mon Sep 17 00:00:00 2001 From: Saxon Date: Mon, 22 Apr 2019 15:14:08 +0930 Subject: [PATCH] av: addressing PR feedback --- revid/revid.go | 14 +++++++------- revid/revid_test.go | 28 ++++++++++++++++++++++++++++ revid/senders.go | 4 ++-- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/revid/revid.go b/revid/revid.go index c9c2bb51..ced432b6 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -21,10 +21,10 @@ LICENSE It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. + for more details. You should have received a copy of the GNU General Public License - along with revid in gpl.txt. If not, see http://www.gnu.org/licenses. + in gpl.txt. If not, see http://www.gnu.org/licenses. */ package revid @@ -92,17 +92,17 @@ type Revid struct { // lexTo, encoder and packer handle transcoding the input stream. lexTo func(dest io.Writer, src io.Reader, delay time.Duration) error - // mwc will hold the multiWriteCloser that writes to encoders from the lexer. + // encoders will hold the multiWriteCloser that writes to encoders from the lexer. encoders io.WriteCloser // isRunning is used to keep track of revid's running state between methods. isRunning bool - // err will channel errors from revid routines to the handle errors routine. - err chan error - // wg will be used to wait for any processing routines to finish. wg sync.WaitGroup + + // err will channel errors from revid routines to the handle errors routine. + err chan error } // New returns a pointer to a new Revid with the desired configuration, and/or @@ -307,7 +307,7 @@ func (r *Revid) Stop() { r.config.Logger.Log(logger.Info, pkg+"closing pipeline") err := r.encoders.Close() if err != nil { - r.config.Logger.Log(logger.Error, pkg+"got error while closing pipeline", "error", err.Error()) + r.config.Logger.Log(logger.Error, pkg+"failed to close pipeline", "error", err.Error()) } if r.cmd != nil && r.cmd.Process != nil { diff --git a/revid/revid_test.go b/revid/revid_test.go index 2ee53151..145e4825 100644 --- a/revid/revid_test.go +++ b/revid/revid_test.go @@ -1,3 +1,31 @@ +/* +NAME + revid_test.go + +DESCRIPTION + See Readme.md + +AUTHORS + Saxon A. Nelson-Milton + Alan Noble + +LICENSE + This is Copyright (C) 2019 the Australian Ocean Lab (AusOcean). + + It is free software: you can redistribute it and/or modify them + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + It is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + in gpl.txt. If not, see http://www.gnu.org/licenses. +*/ + package revid import ( diff --git a/revid/senders.go b/revid/senders.go index 947f5be1..17fa7dc1 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -298,7 +298,7 @@ func (s *rtmpSender) output() { defer s.wg.Done() return default: - // If chunk is nil then we're ready to get another from the ringBuffer. + // If chunk is nil then we're ready to get another from the ring buffer. if chunk == nil { var err error chunk, err = s.ring.Next(0) @@ -342,7 +342,7 @@ func (s *rtmpSender) output() { func (s *rtmpSender) Write(d []byte) (int, error) { _, err := s.ring.Write(d) if err != nil { - s.log(logger.Warning, pkg+"rtmpSender: ringBuffer write error", "error", err.Error()) + s.log(logger.Warning, pkg+"rtmpSender: ring buffer write error", "error", err.Error()) } s.ring.Flush() return len(d), nil