PR feedback and some other clean-up.

This commit is contained in:
Alan Noble 2018-06-27 07:50:05 +09:30
parent 1645b759f1
commit 99ef1d0727
3 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,6 @@
/* /*
NAME NAME
RevidCLI.go revid-cli - command line interface for Revid.
DESCRIPTION DESCRIPTION
See Readme.md See Readme.md
@ -10,7 +10,7 @@ AUTHORS
Jack Richardson <jack@ausocean.org> Jack Richardson <jack@ausocean.org>
LICENSE LICENSE
RevidCLI.go is Copyright (C) 2017-2018 the Australian Ocean Lab (AusOcean) revid-cli is Copyright (C) 2017-2018 the Australian Ocean Lab (AusOcean)
It is free software: you can redistribute it and/or modify them 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 under the terms of the GNU General Public License as published by the
@ -80,7 +80,6 @@ const (
netSendRetryTime = 5 * time.Second netSendRetryTime = 5 * time.Second
defaultRunDuration = 24 * time.Hour defaultRunDuration = 24 * time.Hour
revidStopTime = 5 * time.Second revidStopTime = 5 * time.Second
prepTime = 20 * time.Second
) )
// Globals // Globals

View File

@ -42,8 +42,8 @@ import (
"bitbucket.org/ausocean/av/generator" "bitbucket.org/ausocean/av/generator"
"bitbucket.org/ausocean/av/parser" "bitbucket.org/ausocean/av/parser"
"bitbucket.org/ausocean/av/rtmp" "bitbucket.org/ausocean/av/rtmp"
"bitbucket.org/ausocean/utils/ring"
"bitbucket.org/ausocean/iot/pi/netsender" "bitbucket.org/ausocean/iot/pi/netsender"
"bitbucket.org/ausocean/utils/ring"
) )
// Misc constants // Misc constants
@ -117,7 +117,7 @@ func New(c Config, ns *netsender.Sender) (*Revid, error) {
return &r, nil return &r, nil
} }
// Bitrate returns the resbult of the most recent bitrate check. // Bitrate returns the result of the most recent bitrate check.
func (r *Revid) Bitrate() int { func (r *Revid) Bitrate() int {
return r.bitrate return r.bitrate
} }
@ -235,18 +235,18 @@ func (r *Revid) Start() {
r.Log(Warning, "Revid.Start() called but revid already running!") r.Log(Warning, "Revid.Start() called but revid already running!")
return return
} }
r.Log(Info, "Starting Revid!") r.Log(Info, "Starting Revid")
r.Log(Debug, "Setting up output!") r.Log(Debug, "Setting up output")
r.isRunning = true r.isRunning = true
r.Log(Info, "Starting output routine!") r.Log(Info, "Starting output routine")
go r.outputClips() go r.outputClips()
r.Log(Info, "Starting clip packing routine!") r.Log(Info, "Starting clip packing routine")
go r.packClips() go r.packClips()
r.Log(Info, "Starting packetisation generator!") r.Log(Info, "Starting packetisation generator")
r.generator.Start() r.generator.Start()
r.Log(Info, "Starting parser!") r.Log(Info, "Starting parser")
r.parser.Start() r.parser.Start()
r.Log(Info, "Setting up input and receiving content!") r.Log(Info, "Setting up input and receiving content")
go r.setupInput() go r.setupInput()
} }

View File

@ -119,7 +119,7 @@ func (s *httpSender) load(c *ring.Chunk) error {
return nil return nil
} }
func (s *httpSender) send() (err error) { func (s *httpSender) send() error {
if s.chunk == nil { if s.chunk == nil {
// Do not retry with httpSender, // Do not retry with httpSender,
// so just return without error // so just return without error
@ -139,6 +139,7 @@ func (s *httpSender) send() (err error) {
break break
} }
} }
var err error
if send { if send {
_, _, err = s.client.Send(netsender.RequestPoll, pins) _, _, err = s.client.Send(netsender.RequestPoll, pins)
} }