diff options
author | Jose Antonio Santos Cadenas <santoscadenas@gmail.com> | 2013-04-04 16:32:45 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2013-04-05 09:52:10 +0200 |
commit | a83f96d988bfc323251046f11f1f517a128be2ef (patch) | |
tree | bd95d8a2b12b62b696c5d64cfc0f4ff42dcec311 | |
parent | 48208c61a804f4438fea6cfdb18798965949bcba (diff) |
sdp: Set session as permanent (t=0 0) if there is no time information
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=697277
-rw-r--r-- | gst-libs/gst/sdp/gstsdpmessage.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/gst-libs/gst/sdp/gstsdpmessage.c b/gst-libs/gst/sdp/gstsdpmessage.c index c43394dce..f721939d1 100644 --- a/gst-libs/gst/sdp/gstsdpmessage.c +++ b/gst-libs/gst/sdp/gstsdpmessage.c @@ -399,20 +399,24 @@ gst_sdp_message_as_text (const GstSDPMessage * msg) bandwidth->bandwidth); } - for (i = 0; i < gst_sdp_message_times_len (msg); i++) { - const GstSDPTime *times = gst_sdp_message_get_time (msg, i); - - g_string_append_printf (lines, "t=%s %s\r\n", times->start, times->stop); - - if (times->repeat != NULL) { - guint j; - - g_string_append_printf (lines, "r=%s", - g_array_index (times->repeat, gchar *, 0)); - for (j = 1; j < times->repeat->len; j++) - g_string_append_printf (lines, " %s", - g_array_index (times->repeat, gchar *, j)); - g_string_append_printf (lines, "\r\n"); + if (gst_sdp_message_times_len (msg) == 0) { + g_string_append_printf (lines, "t=0 0\r\n"); + } else { + for (i = 0; i < gst_sdp_message_times_len (msg); i++) { + const GstSDPTime *times = gst_sdp_message_get_time (msg, i); + + g_string_append_printf (lines, "t=%s %s\r\n", times->start, times->stop); + + if (times->repeat != NULL) { + guint j; + + g_string_append_printf (lines, "r=%s", + g_array_index (times->repeat, gchar *, 0)); + for (j = 1; j < times->repeat->len; j++) + g_string_append_printf (lines, " %s", + g_array_index (times->repeat, gchar *, j)); + g_string_append_printf (lines, "\r\n"); + } } } |