From b8c2ccce4ed173fe48bab266f15a70e256b8334c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 10 Dec 2009 18:43:44 +0100 Subject: [PATCH] rtspsrc: handle NULL and empty transport strings When an RTSP extension returns NULL or an empty transport string, just ignore it and try to get the next possible transport. Fixes playback of RealMedia streams. --- gst/rtsp/gstrtspsrc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 7e90c2e16b..1549d9449f 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4310,6 +4310,7 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src) GST_DEBUG_OBJECT (src, "doing setup of stream %p with %s", stream, stream->setup_url); + next_protocol: /* first selectable protocol */ while (protocol_masks[mask] && !(protocols & protocol_masks[mask])) mask++; @@ -4322,9 +4323,15 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src) /* create a string with first transport in line */ res = gst_rtspsrc_create_transports_string (src, protocols & protocol_masks[mask], &transports); - if (res < 0) + if (res < 0 || transports == NULL) goto setup_transport_failed; + if (strlen (transports) == 0) { + GST_DEBUG_OBJECT (src, "no transports found"); + mask++; + goto next_protocol; + } + GST_DEBUG_OBJECT (src, "replace ports in %s", GST_STR_NULL (transports)); /* replace placeholders with real values, this function will optionally