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
This commit is contained in:
Petr Kulhavy 2016-08-30 10:24:43 +02:00 committed by Sebastian Dröge
parent 56b1d088a9
commit 5cdf66d5d2

View file

@ -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;