From c7ec750b4f02cea13e1b87e487850828b0bca8ee Mon Sep 17 00:00:00 2001 From: Saxon1 Date: Sun, 6 May 2018 00:49:34 +0930 Subject: [PATCH] need to stop it from blocking --- revid/Revid.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/revid/Revid.go b/revid/Revid.go index 814c6b6f..07654eed 100644 --- a/revid/Revid.go +++ b/revid/Revid.go @@ -299,14 +299,15 @@ func (r *revid) getFramePacketization() []byte { func (r *revid) flushData() { switch r.config.Packetization { case Flv: - for len(r.generator.GetOutputChan()) > 0 { - <-(r.generator.GetOutputChan()) - } - case None: - for len(r.outputChan) > 0 { - <-r.outputChan + for { + select { + case <-(r.generator.GetOutputChan()): + default: + goto done + } } } + done: } // packClips takes data segments; whether that be tsPackets or mjpeg frames and