Merge branch 'mts-chunking' of https://bitbucket.org/ausocean/av into mts-chunking

This commit is contained in:
Saxon Milton 2019-02-28 07:51:04 +00:00
commit baf033c281
1 changed files with 1 additions and 1 deletions

View File

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