Added way to flush tsPacketChan

This commit is contained in:
Unknown 2018-01-23 17:38:35 +10:30
parent e04dd5c4ee
commit 043f48411c
1 changed files with 5 additions and 1 deletions

View File

@ -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())