mirror of https://bitbucket.org/ausocean/av.git
protocol/rtcp: fixed some further feedback
This commit is contained in:
parent
51478ee064
commit
f66a94543a
|
@ -32,14 +32,14 @@ import (
|
|||
"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
|
||||
// represent a valid receiver report, an error is returned.
|
||||
func Timestamp(buf []byte) (msw, lsw uint32, err error) {
|
||||
if len(buf) < 4 {
|
||||
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")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue