From 20a5ed536218b7fe96dc4ef3f5332e948eebba78 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 11 May 2019 16:30:29 +0930 Subject: [PATCH] container/mts/mpegts.go: renamed pidType to pid in GetPTSRange --- container/mts/mpegts.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/container/mts/mpegts.go b/container/mts/mpegts.go index d0121a6c..b590b8d3 100644 --- a/container/mts/mpegts.go +++ b/container/mts/mpegts.go @@ -319,9 +319,9 @@ func DiscontinuityIndicator(f bool) Option { } // GetPTSRange retreives the first and last PTS of an MPEGTS clip. -func GetPTSRange(clip []byte, pidType uint16) (pts [2]uint64, err error) { +func GetPTSRange(clip []byte, pid uint16) (pts [2]uint64, err error) { // Find the first packet with PID pidType. - pkt, _, err := FindPid(clip, pidType) + pkt, _, err := FindPid(clip, pid) if err != nil { return [2]uint64{}, err } @@ -345,7 +345,7 @@ func GetPTSRange(clip []byte, pidType uint16) (pts [2]uint64, err error) { // Get the final PTS searching from end of clip for access unit start. for i := len(clip) - PacketSize; i >= 0; i -= PacketSize { copy(_pkt[:], clip[i:i+PacketSize]) - if packet.PayloadUnitStartIndicator(&_pkt) && uint16(_pkt.PID()) == pidType { + if packet.PayloadUnitStartIndicator(&_pkt) && uint16(_pkt.PID()) == pid { payload, err = packet.Payload(&_pkt) if err != nil { return [2]uint64{}, err