Merged in http-fix (pull request #65)

Revid side HTTP fix

Approved-by: Alan Noble <anoble@gmail.com>
This commit is contained in:
Saxon Milton 2018-10-02 08:22:48 +00:00 committed by Alan Noble
commit 9d5ba49b7c
1 changed files with 8 additions and 7 deletions

View File

@ -31,7 +31,6 @@ package revid
import (
"errors"
_ "fmt"
"io"
"os"
"os/exec"
@ -116,13 +115,13 @@ type Revid struct {
// an error if construction of the new instance was not successful.
func New(c Config, ns *netsender.Sender) (*Revid, error) {
var r Revid
r.ns = ns
err := r.reset(c)
if err != nil {
return nil, err
}
r.ringBuffer = ring.NewBuffer(ringBufferSize, ringBufferElementSize, writeTimeout)
r.outputChan = make(chan []byte, outputChanSize)
r.ns = ns
return &r, nil
}
@ -472,11 +471,13 @@ func (r *Revid) startRaspivid() error {
return err
}
r.inputReader = stdout
go func() {
r.config.Logger.Log(smartlogger.Info, pkg+"reading camera data")
r.lexTo(r.encoder, r.inputReader, delay)
err = r.lexTo(r.encoder, r.inputReader, delay)
if err != nil {
return err
}
r.config.Logger.Log(smartlogger.Info, pkg+"not trying to read from camera anymore")
}()
return nil
}