From c3df750175a7968c8cee0802e16fc1f552e4a4ba Mon Sep 17 00:00:00 2001
From: Trek H <trek.hopton@gmail.com>
Date: Thu, 12 Sep 2019 23:12:55 +0930
Subject: [PATCH] mts: set nalbasedpsi to false for audio

---
 container/mts/encoder.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/container/mts/encoder.go b/container/mts/encoder.go
index 3249ce56..693b0be3 100644
--- a/container/mts/encoder.go
+++ b/container/mts/encoder.go
@@ -150,10 +150,12 @@ type Encoder struct {
 func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder {
 	var mPid int
 	var sid byte
+	nbp := true
 	switch mediaType {
 	case EncodeAudio:
 		mPid = AudioPid
 		sid = audioStreamID
+		nbp = false
 	case EncodeH265:
 		mPid = VideoPid
 		sid = H265ID
@@ -180,7 +182,7 @@ func NewEncoder(dst io.WriteCloser, rate float64, mediaType int) *Encoder {
 		writePeriod: time.Duration(float64(time.Second) / rate),
 		ptsOffset:   ptsOffset,
 
-		nalBasedPSI: true,
+		nalBasedPSI: nbp,
 
 		pktCount: 8,