h264: Fix H264 SDP payload format.
authorWalter Doekes <walter+asterisk@wjd.nu>
Tue, 13 May 2014 13:53:28 +0000 (13:53 +0000)
committerWalter Doekes <walter+asterisk@wjd.nu>
Tue, 13 May 2014 13:53:28 +0000 (13:53 +0000)
https://tools.ietf.org/html/rfc3984#section-8.1 says profile-level-id
takes 3 bytes in base16 (6 hex digits).

This fixes video setup in certain cases.

ASTERISK-23664 #close
ASTERISK-23664 #comment Patch r3530.patch uploaded by Guillaume Maudoux.
Review: https://reviewboard.asterisk.org/r/3530/
........

Merged revisions 413791 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 413792 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@413793 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_format_attr_h264.c

index 5ecde3f..2bd47e0 100644 (file)
@@ -268,11 +268,11 @@ static void h264_format_attr_sdp_generate(const struct ast_format_attr *format_a
                } else if (i == H264_ATTR_KEY_PROFILE_IDC && format_attr->format_attr[H264_ATTR_KEY_PROFILE_IDC] &&
                    format_attr->format_attr[H264_ATTR_KEY_PROFILE_IOP] && format_attr->format_attr[H264_ATTR_KEY_LEVEL]) {
                        if (!added) {
-                               ast_str_append(str, 0, "a=fmtp:%u profile-level-id=%X%X%X", payload, format_attr->format_attr[H264_ATTR_KEY_PROFILE_IDC],
+                               ast_str_append(str, 0, "a=fmtp:%u profile-level-id=%02X%02X%02X", payload, format_attr->format_attr[H264_ATTR_KEY_PROFILE_IDC],
                                               format_attr->format_attr[H264_ATTR_KEY_PROFILE_IOP], format_attr->format_attr[H264_ATTR_KEY_LEVEL]);
                                added = 1;
                        } else {
-                               ast_str_append(str, 0, ";profile-level-id=%X%X%X", format_attr->format_attr[H264_ATTR_KEY_PROFILE_IDC],
+                               ast_str_append(str, 0, ";profile-level-id=%02X%02X%02X", format_attr->format_attr[H264_ATTR_KEY_PROFILE_IDC],
                                               format_attr->format_attr[H264_ATTR_KEY_PROFILE_IOP], format_attr->format_attr[H264_ATTR_KEY_LEVEL]);
                        }
                } else if ((name = h264_attr_key_to_str(i)) && h264_attr_key_addable(format_attr, i)) {