sdp: warn and skip streams without media
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 3 Jun 2009 10:13:21 +0000 (12:13 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 3 Jun 2009 10:13:21 +0000 (12:13 +0200)
gst/rtsp-server/rtsp-sdp.c

index 3e6c271..264168a 100644 (file)
@@ -63,9 +63,19 @@ gst_rtsp_sdp_from_media (GstRTSPMedia *media)
     GString *fmtp;
 
     stream = gst_rtsp_media_get_stream (media, i);
-    gst_sdp_media_new (&smedia);
+
+    if (stream->caps == NULL) {
+      g_warning ("ignoring stream %d without media type", i);
+      continue;
+    }
 
     s = gst_caps_get_structure (stream->caps, 0);
+    if (s == NULL) {
+      g_warning ("ignoring stream %d without media type", i);
+      continue;
+    }
+
+    gst_sdp_media_new (&smedia);
 
     /* get media type and payload for the m= line */
     caps_str = gst_structure_get_string (s, "media");