sdpmessage: do not append NULL value for session-level attr

If an attribute is defined without value, the generated text
should be 'a=key' rather than 'a=key:'. For media-level, it
has already been done.

https://bugzilla.gnome.org/show_bug.cgi?id=789742
This commit is contained in:
Justin Kim 2017-11-01 12:44:59 +09:00 committed by Matthew Waters
parent cb0b73672c
commit d100180ce3
2 changed files with 2 additions and 1 deletions

View file

@ -570,7 +570,7 @@ gst_sdp_message_as_text (const GstSDPMessage * msg)
if (attr->key) {
g_string_append_printf (lines, "a=%s", attr->key);
if (attr->value)
if (attr->value && attr->value[0] != '\0')
g_string_append_printf (lines, ":%s", attr->value);
g_string_append_printf (lines, "\r\n");
}

View file

@ -53,6 +53,7 @@ static const gchar *sdp = "v=0\r\n"
"s=TestSessionToCopy\r\n"
"c=IN IP4 127.0.0.1\r\n"
"t=0 0\r\n"
"a=sendrecv\r\n"
"m=video 3434 RTP/AVP 96 97 99\r\n"
"a=rtpmap:96 MP4V-ES/90000\r\n"
"a=rtpmap:97 H263-1998/90000\r\n"