protocol/rtcp: fixed some further feedback

This commit is contained in:
Saxon 2019-04-16 17:17:48 +09:30
parent 51478ee064
commit f66a94543a
1 changed files with 2 additions and 2 deletions

View File

@ -32,14 +32,14 @@ import (
"errors" "errors"
) )
// Timestamp gets the timestamp from a receiver report and returns as the most // Timestamp gets the timestamp from a receiver report and returns it as the most
// significant word, and the least significant word. If the given bytes do not // significant word, and the least significant word. If the given bytes do not
// represent a valid receiver report, an error is returned. // represent a valid receiver report, an error is returned.
func Timestamp(buf []byte) (msw, lsw uint32, err error) { func Timestamp(buf []byte) (msw, lsw uint32, err error) {
if len(buf) < 4 { if len(buf) < 4 {
return 0, 0, errors.New("bad RTCP packet, not of sufficient length") return 0, 0, errors.New("bad RTCP packet, not of sufficient length")
} }
if (buf[0]&0xc0)>>6 != 2 { if (buf[0]&0xc0)>>6 != rtpVer {
return 0, 0, errors.New("incompatible RTCP version") return 0, 0, errors.New("incompatible RTCP version")
} }