mirror of https://bitbucket.org/ausocean/av.git
printing clearing output chan less
This commit is contained in:
parent
e76deb3864
commit
8282cd3880
|
@ -339,18 +339,23 @@ done:
|
|||
func (r *revid) packClips() {
|
||||
clipSize := 0
|
||||
packetCount := 0
|
||||
outputChanFullFlag := false
|
||||
for r.isRunning {
|
||||
// Get some memory from the ring buffer for out clip
|
||||
var clip []byte
|
||||
var err error
|
||||
if clip, err = r.ringBuffer.Get(); err != nil && r.isRunning {
|
||||
r.Log(Error, err.Error())
|
||||
r.Log(Warning, "Clearing output chan!")
|
||||
if !outputChanFullFlag {
|
||||
r.Log(Error, err.Error())
|
||||
r.Log(Warning, "Clearing output chan!")
|
||||
outputChanFullFlag = true
|
||||
}
|
||||
for clip, err = r.ringBuffer.Get(); err != nil && r.isRunning; {
|
||||
time.Sleep(time.Duration(10) * time.Millisecond)
|
||||
clip, err = r.ringBuffer.Get()
|
||||
}
|
||||
r.Log(Debug, "Finally got mem from ringbuffer!")
|
||||
outputChanFullFlag = false
|
||||
}
|
||||
|
||||
for r.isRunning {
|
||||
|
|
Loading…
Reference in New Issue