diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index 78a841f5..74df4746 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -178,7 +178,7 @@ func (e *Encoder) TimeBasedPsi(b bool, sendCount int) { // sending them to the output channel. func (e *Encoder) Encode(nalu []byte) error { now := time.Now() - if (e.timeBasedPsi && (now.Sub(e.psiLastTime) > psiInterval)) || e.pktCount >= e.psiSendCount { + if (e.timeBasedPsi && (now.Sub(e.psiLastTime) > psiInterval)) || (!e.timeBasedPsi && (e.pktCount >= e.psiSendCount)) { e.pktCount = 0 err := e.writePSI() if err != nil {