From e76b8b3800eacf07db4380e24e851c158db0e7be Mon Sep 17 00:00:00 2001 From: scruzin Date: Sat, 13 Jul 2019 09:17:44 +0930 Subject: [PATCH] Tidy up errors used by GetPTS(). --- container/mts/mpegts.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/container/mts/mpegts.go b/container/mts/mpegts.go index 484254fe..0b356770 100644 --- a/container/mts/mpegts.go +++ b/container/mts/mpegts.go @@ -419,10 +419,12 @@ func GetPTSRange(clip []byte, pid uint16) (pts [2]uint64, err error) { return } -var errNoPesPayload = errors.New("no PES payload") -var errNoPesPTS = errors.New("no PES PTS") -var errInvalidPesHeader = errors.New("invalid PES header") -var errInvalidPesPayload = errors.New("invalid PES payload") +var ( + errNoPesPayload = errors.New("no PES payload") + errNoPesPTS = errors.New("no PES PTS") + 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. func GetPTS(pkt []byte) (pts int64, err error) {