Commit f9ef4324 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use strings.Cut when parsing fmtp.

parent d2380f25
......@@ -181,12 +181,9 @@ func (g *Group) API() (*webrtc.API, error) {
func fmtpValue(fmtp, key string) string {
fields := strings.Split(fmtp, ";")
for _, f := range fields {
kv := strings.SplitN(f, "=", 2)
if len(kv) != 2 {
continue
}
if kv[0] == key {
return kv[1]
k, v, found := strings.Cut(f, "=")
if found && k == key {
return v
}
}
return ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment