mirror of https://bitbucket.org/ausocean/av.git
psi: d to dst in updateTime
This commit is contained in:
parent
d961cf172d
commit
404a2b6c99
|
@ -64,16 +64,16 @@ func HasLocation(p []byte) error {
|
|||
// UpdateTime takes the byte slice representation of a psi-pmt as well as a time
|
||||
// as an integer and attempts to update the time descriptor in the pmt with the
|
||||
// given time if the time descriptor exists, otherwise an error is returned
|
||||
func UpdateTime(d []byte, t uint64) error {
|
||||
err := HasTime(d)
|
||||
func UpdateTime(dst []byte, t uint64) error {
|
||||
err := HasTime(dst)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ts := TimeBytes(uint64(t))
|
||||
for i := range d[timeDataIndx : timeDataIndx+timeDataSize] {
|
||||
d[i+timeDataIndx] = ts[i]
|
||||
for i := range dst[timeDataIndx : timeDataIndx+timeDataSize] {
|
||||
dst[i+timeDataIndx] = ts[i]
|
||||
}
|
||||
d = updateCrc(d)
|
||||
dst = updateCrc(dst)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue