From: Sean Bright Date: Tue, 23 May 2017 15:06:02 +0000 (-0400) Subject: res_format_attr_h26x: Trim blanks in fmtp attributes X-Git-Tag: 15.0.0-beta1~129^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8ae0227cf33ee6abfdaa29b90864d52faacc5d2c;p=thirdparty%2Fasterisk.git res_format_attr_h26x: Trim blanks in fmtp attributes Some devices separate format attributes with a semicolon followed by a space, so trim blanks before trying to match them. ASTERISK-27008 #close Change-Id: Ia44cb2e4fef5c73dc541a29da79cb0e19c22d9cc --- diff --git a/res/res_format_attr_h263.c b/res/res_format_attr_h263.c index 139fbf17aa..a32f40f7d5 100644 --- a/res/res_format_attr_h263.c +++ b/res/res_format_attr_h263.c @@ -156,6 +156,8 @@ static struct ast_format *h263_parse_sdp_fmtp(const struct ast_format *format, c while ((attrib = strsep(&attribs, ";"))) { unsigned int val, val2 = 0, val3 = 0, val4 = 0; + attrib = ast_strip(attrib); + if (sscanf(attrib, "SQCIF=%30u", &val) == 1) { attr->SQCIF = val; } else if (sscanf(attrib, "QCIF=%30u", &val) == 1) { diff --git a/res/res_format_attr_h264.c b/res/res_format_attr_h264.c index 29d495bc77..fa3339543b 100644 --- a/res/res_format_attr_h264.c +++ b/res/res_format_attr_h264.c @@ -184,6 +184,8 @@ static struct ast_format *h264_parse_sdp_fmtp(const struct ast_format *format, c unsigned int val; unsigned long int val2; + attrib = ast_strip(attrib); + if (sscanf(attrib, "profile-level-id=%lx", &val2) == 1) { attr->PROFILE_IDC = ((val2 >> 16) & 0xFF); attr->PROFILE_IOP = ((val2 >> 8) & 0xFF);