need to stop it from blocking

This commit is contained in:
Saxon1 2018-05-06 00:49:34 +09:30
parent 6500eef888
commit c7ec750b4f
1 changed files with 7 additions and 6 deletions

View File

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