From 31025a114abba107b2b40b10275ce035790c21f8 Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 28 Feb 2019 18:19:06 +1030 Subject: [PATCH] stream/mts: fixed logic regarding psi writing frequency --- stream/mts/encoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {