rtspsrc: handle * control correctly
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 5 Apr 2011 15:12:28 +0000 (17:12 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 5 Apr 2011 15:12:28 +0000 (17:12 +0200)
Parse session control attributes when no media control attribute is
present. Threat * control attributes as an empty string, just like the
spec says.

Fixes #646800

gst/rtsp/gstrtspsrc.c

index fbd57e0..8990d6f 100644 (file)
@@ -1026,6 +1026,8 @@ gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx)
    * configure the transport of the stream and is used to identity the stream in
    * the RTP-Info header field returned from PLAY. */
   control_url = gst_sdp_media_get_attribute_val (media, "control");
+  if (control_url == NULL)
+    control_url = gst_sdp_message_get_attribute_val_n (sdp, "control", 0);
 
   GST_DEBUG_OBJECT (src, "stream %d, (%p)", stream->id, stream);
   GST_DEBUG_OBJECT (src, " pt: %d", stream->pt);
@@ -1047,6 +1049,9 @@ gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx)
       const gchar *base;
       gboolean has_slash;
 
+      if (g_strcmp0 (control_url, "*") == 0)
+        control_url = "";
+
       if (src->control)
         base = src->control;
       else if (src->content_base)