mirror of https://bitbucket.org/ausocean/av.git
PR feedback and some other clean-up.
This commit is contained in:
parent
1645b759f1
commit
99ef1d0727
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
NAME
|
||||
RevidCLI.go
|
||||
revid-cli - command line interface for Revid.
|
||||
|
||||
DESCRIPTION
|
||||
See Readme.md
|
||||
|
@ -10,7 +10,7 @@ AUTHORS
|
|||
Jack Richardson <jack@ausocean.org>
|
||||
|
||||
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
|
||||
under the terms of the GNU General Public License as published by the
|
||||
|
@ -80,7 +80,6 @@ const (
|
|||
netSendRetryTime = 5 * time.Second
|
||||
defaultRunDuration = 24 * time.Hour
|
||||
revidStopTime = 5 * time.Second
|
||||
prepTime = 20 * time.Second
|
||||
)
|
||||
|
||||
// Globals
|
||||
|
|
|
@ -42,8 +42,8 @@ import (
|
|||
"bitbucket.org/ausocean/av/generator"
|
||||
"bitbucket.org/ausocean/av/parser"
|
||||
"bitbucket.org/ausocean/av/rtmp"
|
||||
"bitbucket.org/ausocean/utils/ring"
|
||||
"bitbucket.org/ausocean/iot/pi/netsender"
|
||||
"bitbucket.org/ausocean/utils/ring"
|
||||
)
|
||||
|
||||
// Misc constants
|
||||
|
@ -117,7 +117,7 @@ func New(c Config, ns *netsender.Sender) (*Revid, error) {
|
|||
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 {
|
||||
return r.bitrate
|
||||
}
|
||||
|
@ -235,18 +235,18 @@ func (r *Revid) Start() {
|
|||
r.Log(Warning, "Revid.Start() called but revid already running!")
|
||||
return
|
||||
}
|
||||
r.Log(Info, "Starting Revid!")
|
||||
r.Log(Debug, "Setting up output!")
|
||||
r.Log(Info, "Starting Revid")
|
||||
r.Log(Debug, "Setting up output")
|
||||
r.isRunning = true
|
||||
r.Log(Info, "Starting output routine!")
|
||||
r.Log(Info, "Starting output routine")
|
||||
go r.outputClips()
|
||||
r.Log(Info, "Starting clip packing routine!")
|
||||
r.Log(Info, "Starting clip packing routine")
|
||||
go r.packClips()
|
||||
r.Log(Info, "Starting packetisation generator!")
|
||||
r.Log(Info, "Starting packetisation generator")
|
||||
r.generator.Start()
|
||||
r.Log(Info, "Starting parser!")
|
||||
r.Log(Info, "Starting parser")
|
||||
r.parser.Start()
|
||||
r.Log(Info, "Setting up input and receiving content!")
|
||||
r.Log(Info, "Setting up input and receiving content")
|
||||
go r.setupInput()
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ func (s *httpSender) load(c *ring.Chunk) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *httpSender) send() (err error) {
|
||||
func (s *httpSender) send() error {
|
||||
if s.chunk == nil {
|
||||
// Do not retry with httpSender,
|
||||
// so just return without error
|
||||
|
@ -139,6 +139,7 @@ func (s *httpSender) send() (err error) {
|
|||
break
|
||||
}
|
||||
}
|
||||
var err error
|
||||
if send {
|
||||
_, _, err = s.client.Send(netsender.RequestPoll, pins)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue