udpsrc: print information about bind_error socket error
authorMarc Leeman <marc.leeman@gmail.com>
Wed, 16 May 2018 12:15:13 +0000 (14:15 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 27 Oct 2018 12:12:53 +0000 (13:12 +0100)
In some cases, a bind error occurs during operation. Printing
the information about the problem is critical for finding the
conflict

https://bugzilla.gnome.org/show_bug.cgi?id=797340

gst/udp/gstudpsrc.c

index d38c2df..0ac896f 100644 (file)
@@ -1363,8 +1363,10 @@ gst_udpsrc_open (GstUDPSrc * src)
 
     bind_saddr = g_inet_socket_address_new (bind_addr, src->port);
     g_object_unref (bind_addr);
-    if (!g_socket_bind (src->used_socket, bind_saddr, src->reuse, &err))
+    if (!g_socket_bind (src->used_socket, bind_saddr, src->reuse, &err)) {
+      GST_ERROR_OBJECT (src, "%s: error binding to %s:%d", err->message, src->address, src->port);
       goto bind_error;
+    }
 
     g_object_unref (bind_saddr);
     g_socket_set_multicast_loopback (src->used_socket, src->loop);