From a0fb380717c61c5e545b7f7d85cb6f72a2cb88c0 Mon Sep 17 00:00:00 2001 From: Saxon Date: Wed, 10 Apr 2019 12:52:05 +0930 Subject: [PATCH] protocol/rtp: simplified hasExt function --- protocol/rtp/parse.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/protocol/rtp/parse.go b/protocol/rtp/parse.go index 06a5d41b..121364cf 100644 --- a/protocol/rtp/parse.go +++ b/protocol/rtp/parse.go @@ -54,10 +54,7 @@ func Payload(d []byte) ([]byte, error) { // hasExt returns true if an extension is present in the RTP packet. The version // must be compatible otherwise we panic. func hasExt(d []byte) bool { - if (d[0] & 0x10 >> 4) == 1 { - return true - } - return false + return (d[0] & 0x10 >> 4) == 1 } // csrcCount returns the number of CSRC fields. If the version is not compatible