protocol/rtp: updated parse.go function comments

This commit is contained in:
Saxon 2019-04-10 16:56:32 +09:30
parent a0fb380717
commit 0700a8270d
1 changed files with 2 additions and 4 deletions

View File

@ -51,14 +51,12 @@ func Payload(d []byte) ([]byte, error) {
return d[payloadIdx:], nil return d[payloadIdx:], nil
} }
// hasExt returns true if an extension is present in the RTP packet. The version // hasExt returns true if an extension is present in the RTP packet.
// must be compatible otherwise we panic.
func hasExt(d []byte) bool { func hasExt(d []byte) bool {
return (d[0] & 0x10 >> 4) == 1 return (d[0] & 0x10 >> 4) == 1
} }
// csrcCount returns the number of CSRC fields. If the version is not compatible // csrcCount returns the number of CSRC fields.
// we panic.
func csrcCount(d []byte) int { func csrcCount(d []byte) int {
return int(d[0] & 0x0f) return int(d[0] & 0x0f)
} }