Tidy up errors used by GetPTS().

This commit is contained in:
scruzin 2019-07-13 09:17:44 +09:30
parent 590bdc2c2d
commit e76b8b3800
1 changed files with 6 additions and 4 deletions

View File

@ -419,10 +419,12 @@ func GetPTSRange(clip []byte, pid uint16) (pts [2]uint64, err error) {
return return
} }
var errNoPesPayload = errors.New("no PES payload") var (
var errNoPesPTS = errors.New("no PES PTS") errNoPesPayload = errors.New("no PES payload")
var errInvalidPesHeader = errors.New("invalid PES header") errNoPesPTS = errors.New("no PES PTS")
var errInvalidPesPayload = errors.New("invalid PES payload") errInvalidPesHeader = errors.New("invalid PES header")
errInvalidPesPayload = errors.New("invalid PES payload")
)
// GetPTS returns a PTS from a packet that has PES payload, or an error otherwise. // GetPTS returns a PTS from a packet that has PES payload, or an error otherwise.
func GetPTS(pkt []byte) (pts int64, err error) { func GetPTS(pkt []byte) (pts int64, err error) {