mirror of https://bitbucket.org/ausocean/av.git
stream/mts: fixed logic regarding psi writing frequency
This commit is contained in:
parent
651e4d892a
commit
31025a114a
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue