From dfe462a7d1de11f39d50a3ea0001c00f33df283a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AE=87=E7=BF=94?= <11123448@vivo.xyz> Date: Wed, 23 Jun 2021 17:54:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=B9Codec=E5=88=A4?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdp-parser.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdp-parser.go b/sdp-parser.go index 0aea15f..f9c9ed8 100644 --- a/sdp-parser.go +++ b/sdp-parser.go @@ -57,8 +57,9 @@ func ParseSDP(sdpRaw string) map[string]*SDPInfo { } keyval = strings.Split(field, "/") if len(keyval) >= 2 { - info.Codec = keyval[0] - switch info.Codec { + switch keyval[0] { + case "H264", "H265", "PCMA", "PCMU": + info.Codec = keyval[0] case "MPEG4-GENERIC": info.Codec = "AAC" }