This commit is contained in:
richardsonjack 2018-05-24 12:13:05 +09:30
commit 63f56a964f
1 changed files with 7 additions and 2 deletions

View File

@ -339,18 +339,23 @@ done:
func (r *revid) packClips() { func (r *revid) packClips() {
clipSize := 0 clipSize := 0
packetCount := 0 packetCount := 0
outputChanFullFlag := false
for r.isRunning { for r.isRunning {
// Get some memory from the ring buffer for out clip // Get some memory from the ring buffer for out clip
var clip []byte var clip []byte
var err error var err error
if clip, err = r.ringBuffer.Get(); err != nil && r.isRunning { if clip, err = r.ringBuffer.Get(); err != nil && r.isRunning {
r.Log(Error, err.Error()) if !outputChanFullFlag {
r.Log(Warning, "Clearing output chan!") r.Log(Error, err.Error())
r.Log(Warning, "Clearing output chan!")
outputChanFullFlag = true
}
for clip, err = r.ringBuffer.Get(); err != nil && r.isRunning; { for clip, err = r.ringBuffer.Get(); err != nil && r.isRunning; {
time.Sleep(time.Duration(10) * time.Millisecond) time.Sleep(time.Duration(10) * time.Millisecond)
clip, err = r.ringBuffer.Get() clip, err = r.ringBuffer.Get()
} }
r.Log(Debug, "Finally got mem from ringbuffer!") r.Log(Debug, "Finally got mem from ringbuffer!")
outputChanFullFlag = false
} }
for r.isRunning { for r.isRunning {