summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-11-20 09:20:43 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2015-11-20 09:20:43 -0600
commit66d9eab072815049d70d9fb8acd4780f6eba1576 (patch)
treedca3a402f975aaa8d7c9b4afe097de1eb74ed3ed
parent1ef6c35367e692e6f41ba9e97217bda96406ce4c (diff)
parent92ea46ba94028c7082a0e1ae8fb22d9a327c90fa (diff)
Merge "res_format_attr_h264: Do not reset string buffer."
-rw-r--r--res/res_format_attr_h264.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/res/res_format_attr_h264.c b/res/res_format_attr_h264.c
index 95274691c..ccf2176f2 100644
--- a/res/res_format_attr_h264.c
+++ b/res/res_format_attr_h264.c
@@ -236,7 +236,7 @@ static struct ast_format *h264_parse_sdp_fmtp(const struct ast_format *format, c
if (field != H264_ATTR_KEY_UNSET) { \
if (added) { \
ast_str_append(str, 0, ";"); \
- } else { \
+ } else if (0 < ast_str_append(str, 0, "a=fmtp:%u ", payload)) { \
added = 1; \
} \
ast_str_append(str, 0, "%s=%u", name, field); \
@@ -247,7 +247,7 @@ static struct ast_format *h264_parse_sdp_fmtp(const struct ast_format *format, c
if (field) { \
if (added) { \
ast_str_append(str, 0, ";"); \
- } else { \
+ } else if (0 < ast_str_append(str, 0, "a=fmtp:%u ", payload)) { \
added = 1; \
} \
ast_str_append(str, 0, "%s=%u", name, field); \
@@ -263,8 +263,6 @@ static void h264_generate_sdp_fmtp(const struct ast_format *format, unsigned int
return;
}
- ast_str_append(str, 0, "a=fmtp:%u ", payload);
-
APPEND_IF_NONZERO(attr->MAX_MBPS, str, "max-mbps");
APPEND_IF_NONZERO(attr->MAX_FS, str, "max-fs");
APPEND_IF_NONZERO(attr->MAX_CPB, str, "max-cpb");
@@ -287,7 +285,7 @@ static void h264_generate_sdp_fmtp(const struct ast_format *format, unsigned int
if (attr->PROFILE_IDC && attr->PROFILE_IOP && attr->LEVEL) {
if (added) {
ast_str_append(str, 0, ";");
- } else {
+ } else if (0 < ast_str_append(str, 0, "a=fmtp:%u ", payload)) {
added = 1;
}
ast_str_append(str, 0, "profile-level-id=%02X%02X%02X", attr->PROFILE_IDC, attr->PROFILE_IOP, attr->LEVEL);
@@ -296,15 +294,13 @@ static void h264_generate_sdp_fmtp(const struct ast_format *format, unsigned int
if (!ast_strlen_zero(attr->SPS) && !ast_strlen_zero(attr->PPS)) {
if (added) {
ast_str_append(str, 0, ";");
- } else {
+ } else if (0 < ast_str_append(str, 0, "a=fmtp:%u ", payload)) {
added = 1;
}
- ast_str_append(str, 0, ";sprop-parameter-sets=%s,%s", attr->SPS, attr->PPS);
+ ast_str_append(str, 0, "sprop-parameter-sets=%s,%s", attr->SPS, attr->PPS);
}
- if (!added) {
- ast_str_reset(*str);
- } else {
+ if (added) {
ast_str_append(str, 0, "\r\n");
}