]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_format_attr_h26x: Trim blanks in fmtp attributes
authorSean Bright <sean.bright@gmail.com>
Tue, 23 May 2017 15:06:02 +0000 (11:06 -0400)
committerSean Bright <sean.bright@gmail.com>
Tue, 23 May 2017 15:57:50 +0000 (10:57 -0500)
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

res/res_format_attr_h263.c
res/res_format_attr_h264.c

index d65a89fea336e8cb8cc46625a457172c8868c9e0..42dde5ad717ba278f230aa6beb070ead8a3ae072 100644 (file)
@@ -158,6 +158,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) {
index ccf2176f2d6ccf791d1597501b9d9ce93bbeb2f9..030d0d57d4d53bc3a65f78df4f1ccb33d261e20c 100644 (file)
@@ -186,6 +186,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);