mirror of https://bitbucket.org/ausocean/av.git
fixing issues
This commit is contained in:
parent
145708c334
commit
b111d98892
|
@ -135,7 +135,6 @@ func NewRevid(config Config) (r *revid, err error) {
|
|||
return
|
||||
}
|
||||
r.outputChan = make(chan []byte, outputChanSize)
|
||||
r.parser.Start()
|
||||
go r.packClips()
|
||||
return
|
||||
}
|
||||
|
@ -209,7 +208,6 @@ func (r *revid) changeState(config Config) error {
|
|||
// to perform packetization
|
||||
r.getFrame = r.getFramePacketization
|
||||
r.parser.SetOutputChan(r.generator.GetInputChan())
|
||||
r.generator.Start()
|
||||
noPacketizationSetup:
|
||||
|
||||
return nil
|
||||
|
@ -262,6 +260,10 @@ func (r *revid) Start() {
|
|||
}
|
||||
}
|
||||
go r.setupInput()
|
||||
|
||||
r.parser.Start()
|
||||
r.generator.Start()
|
||||
|
||||
go r.outputClips()
|
||||
r.isRunning = true
|
||||
}
|
||||
|
@ -328,7 +330,7 @@ func (r *revid) packClips() {
|
|||
// Get some memory from the ring buffer for out clip
|
||||
var clip []byte
|
||||
var err error
|
||||
if clip, err = r.ringBuffer.Get(); err != nil {
|
||||
if clip, err = r.ringBuffer.Get(); err != nil && r.isRunning {
|
||||
r.Log(Error, err.Error())
|
||||
r.Log(Warning, "Clearing output chan!")
|
||||
for clip, err = r.ringBuffer.Get(); err != nil && r.isRunning; {
|
||||
|
|
Loading…
Reference in New Issue