container/mts/mpegts.go: renamed pidType to pid in GetPTSRange

This commit is contained in:
Saxon 2019-05-11 16:30:29 +09:30
parent 5652b05c21
commit 20a5ed5362
1 changed files with 3 additions and 3 deletions

View File

@ -319,9 +319,9 @@ func DiscontinuityIndicator(f bool) Option {
} }
// GetPTSRange retreives the first and last PTS of an MPEGTS clip. // 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. // Find the first packet with PID pidType.
pkt, _, err := FindPid(clip, pidType) pkt, _, err := FindPid(clip, pid)
if err != nil { if err != nil {
return [2]uint64{}, err 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. // Get the final PTS searching from end of clip for access unit start.
for i := len(clip) - PacketSize; i >= 0; i -= PacketSize { for i := len(clip) - PacketSize; i >= 0; i -= PacketSize {
copy(_pkt[:], clip[i: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) payload, err = packet.Payload(&_pkt)
if err != nil { if err != nil {
return [2]uint64{}, err return [2]uint64{}, err