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 { for {
if clip, err := r.ringBuffer.Get(); err != nil { if clip, err := r.ringBuffer.Get(); err != nil {
r.ErrOut(err.Error()) 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 { } else {
for { for {
tsPacket := <-(r.generator.GetTsOutputChan()) tsPacket := <-(r.generator.GetTsOutputChan())