From 99a9d2873cd09d0caf92078410e4f65cc246bd90 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 5 Mar 2014 15:44:25 +0100 Subject: [PATCH] rtspsrc: handle NULL control urls better --- gst/rtsp/gstrtspsrc.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 8eb39e85a9..5127785d3d 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1170,16 +1170,20 @@ find_stream_by_udpsrc (GstRTSPStream * stream, gconstpointer a) static gint find_stream_by_setup (GstRTSPStream * stream, gconstpointer a) { - /* check qualified setup_url */ - if (!strcmp (stream->conninfo.location, (gchar *) a)) - return 0; - /* check original control_url */ - if (!strcmp (stream->control_url, (gchar *) a)) - return 0; + if (stream->conninfo.location) { + /* check qualified setup_url */ + if (!strcmp (stream->conninfo.location, (gchar *) a)) + return 0; + } + if (stream->control_url) { + /* check original control_url */ + if (!strcmp (stream->control_url, (gchar *) a)) + return 0; - /* check if qualified setup_url ends with string */ - if (g_str_has_suffix (stream->control_url, (gchar *) a)) - return 0; + /* check if qualified setup_url ends with string */ + if (g_str_has_suffix (stream->control_url, (gchar *) a)) + return 0; + } return -1; }