Include PID in mts.FindPid error

Approved-by: Trek Hopton
Approved-by: David Sutton
This commit is contained in:
Alan Noble 2023-11-12 06:42:45 +00:00
parent d9301fe40c
commit 59bf9d15a8
1 changed files with 2 additions and 3 deletions

View File

@ -176,7 +176,6 @@ func FindPat(d []byte) ([]byte, int, error) {
// Errors used by FindPid.
var (
ErrInvalidLen = errors.New("MPEG-TS data not of valid length")
errCouldNotFind = errors.New("could not find packet with given PID")
)
// FindPid will take a clip of MPEG-TS and try to find a packet with given PID - if one
@ -192,7 +191,7 @@ func FindPid(d []byte, pid uint16) (pkt []byte, i int, err error) {
return
}
}
return nil, -1, errCouldNotFind
return nil, -1, fmt.Errorf("could not find packet with PID %d", pid)
}
// LastPid will take a clip of MPEG-TS and try to find a packet
@ -211,7 +210,7 @@ func LastPid(d []byte, pid uint16) (pkt []byte, i int, err error) {
return
}
}
return nil, -1, errCouldNotFind
return nil, -1, fmt.Errorf("could not find packet with PID %d", pid)
}
// Errors used by FindPSI.