rtsp-stream: Compare IP address strings case insensitive
[platform/upstream/gstreamer.git] / gst / rtsp-server / rtsp-stream.c
index 5773fa6..c57d13d 100644 (file)
@@ -1056,7 +1056,7 @@ gst_rtsp_stream_reserve_address (GstRTSPStream * stream,
     /* FIXME: Also reserve the same port with unicast ANY address, since that's
      * where we are going to bind our socket. */
   } else {
-    if (strcmp ((*addrp)->address, address) ||
+    if (g_ascii_strcasecmp ((*addrp)->address, address) ||
         (*addrp)->port != port || (*addrp)->n_ports != n_ports ||
         (*addrp)->ttl != ttl)
       goto different_address;
@@ -1082,8 +1082,9 @@ no_address:
   }
 different_address:
   {
-    GST_ERROR_OBJECT (stream, "address %s is not the same that was already"
-        " reserved", address);
+    GST_ERROR_OBJECT (stream,
+        "address %s is not the same as %s that was already" " reserved",
+        address, (*addrp)->address);
     g_mutex_unlock (&priv->lock);
     return NULL;
   }
@@ -1284,7 +1285,10 @@ again:
     tmp_rtp = addr->port;
 
     g_clear_object (&inetaddr);
-    inetaddr = g_inet_address_new_from_string (addr->address);
+    if (multicast)
+      inetaddr = g_inet_address_new_any (family);
+    else
+      inetaddr = g_inet_address_new_from_string (addr->address);
   } else {
     if (tmp_rtp != 0) {
       tmp_rtp += 2;