From 043f48411c0e7e39000ffbeda6361359a696fa83 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 23 Jan 2018 17:38:35 +1030 Subject: [PATCH] Added way to flush tsPacketChan --- revid/RevidInstance.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/revid/RevidInstance.go b/revid/RevidInstance.go index ab1f6d40..3daa78b7 100644 --- a/revid/RevidInstance.go +++ b/revid/RevidInstance.go @@ -253,7 +253,11 @@ func (r *revidInst) input() { for { if clip, err := r.ringBuffer.Get(); err != nil { r.ErrOut(err.Error()) - time.Sleep(5*time.Second) + tsPktChanLen := len(r.generator.GetTsOutputChan()) + for i := 0; i < tsPktChanLen; i++ { + <-(r.generator.GetTsOutputChan()) + } + time.Sleep(1*time.Second) } else { for { tsPacket := <-(r.generator.GetTsOutputChan())