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