summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Kulhavy <brain@jikos.cz>2016-08-30 10:24:43 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-11-01 20:13:49 +0200
commit5cdf66d5d2f6ad4bea9206b451674a2a64ed784f (patch)
treeefaa58e0d0fc94cca9d8884f65b55369156e905e
parent56b1d088a9a6c69f8c1f3067bc261e88632fae4a (diff)
rtspsrc: allow missing control attribute in case of a single stream
Improve RFC2326 - chapter C.3 compatibility: In case just a single stream is specified in SDP and the control attribute is missing do not drop the stream but rather assume "a=control:*" https://bugzilla.gnome.org/show_bug.cgi?id=770568
-rw-r--r--gst/rtsp/gstrtspsrc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 7e942d090..7e0d85a70 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -1612,7 +1612,8 @@ clear_ptmap_item (PtMapItem * item)
}
static GstRTSPStream *
-gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx)
+gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx,
+ gint n_streams)
{
GstRTSPStream *stream;
const gchar *control_url;
@@ -1667,6 +1668,11 @@ gst_rtspsrc_create_stream (GstRTSPSrc * src, GstSDPMessage * sdp, gint idx)
GST_DEBUG_OBJECT (src, " container: %d", stream->container);
GST_DEBUG_OBJECT (src, " control: %s", GST_STR_NULL (control_url));
+ /* RFC 2326, C.3: missing control_url permitted in case of a single stream */
+ if (control_url == NULL && n_streams == 1) {
+ control_url = "";
+ }
+
if (control_url != NULL) {
stream->control_url = g_strdup (control_url);
/* Build a fully qualified url using the content_base if any or by prefixing
@@ -6668,7 +6674,7 @@ gst_rtspsrc_open_from_sdp (GstRTSPSrc * src, GstSDPMessage * sdp,
/* create streams */
n_streams = gst_sdp_message_medias_len (sdp);
for (i = 0; i < n_streams; i++) {
- gst_rtspsrc_create_stream (src, sdp, i);
+ gst_rtspsrc_create_stream (src, sdp, i, n_streams);
}
src->state = GST_RTSP_STATE_INIT;