summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Franke <df@dfranke.us>2008-09-25 10:34:39 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-09-25 10:34:39 +0000
commitedd6239979fafeaf9735effd452878d79ea5002c (patch)
tree6da26f29543fa85b65112f92cb82a9fbd08f44f3
parentbf8777356bd15858d69d520b7134f20eeeded01c (diff)
downloadgstreamer-plugins-good-edd6239979fafeaf9735effd452878d79ea5002c.tar.gz
gst/udp/gstudpsrc.c: OS X's bind() implementation is picky about its addrlen parameter and fails with EINVAL if it is...
Original commit message from CVS: Patch by: Daniel Franke <df at dfranke dot us> * gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start): OS X's bind() implementation is picky about its addrlen parameter and fails with EINVAL if it is larger than expected for the socket's address family. Set the length to the expected length instead. Fixes #553191.
-rw-r--r--ChangeLog9
-rw-r--r--gst/udp/gstudpsrc.c13
2 files changed, 12 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 1dbf288fd..87d8acd2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-25 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ Patch by: Daniel Franke <df at dfranke dot us>
+
+ * gst/udp/gstudpsrc.c: (gst_udpsrc_create), (gst_udpsrc_start):
+ OS X's bind() implementation is picky about its addrlen parameter and
+ fails with EINVAL if it is larger than expected for the socket's address
+ family. Set the length to the expected length instead. Fixes #553191.
+
2008-09-23 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_open):
diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c
index ed0dbc0bf..0f2af4572 100644
--- a/gst/udp/gstudpsrc.c
+++ b/gst/udp/gstudpsrc.c
@@ -376,26 +376,18 @@ static GstFlowReturn
gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf)
{
GstUDPSrc *udpsrc;
-
GstNetBuffer *outbuf;
-
struct sockaddr_storage tmpaddr;
-
socklen_t len;
-
guint8 *pktdata;
-
gint pktsize;
-
#ifdef G_OS_UNIX
gint readsize;
#elif defined G_OS_WIN32
gulong readsize;
#endif
GstClockTime timeout;
-
gint ret;
-
gboolean try_again;
udpsrc = GST_UDPSRC_CAST (psrc);
@@ -787,8 +779,9 @@ gst_udpsrc_start (GstBaseSrc * bsrc)
goto setsockopt_error;
GST_DEBUG_OBJECT (src, "binding on port %d", src->port);
- if ((ret = bind (src->sock.fd, (struct sockaddr *) &src->myaddr,
- sizeof (src->myaddr))) < 0)
+ /* Mac OS is picky about the size */
+ len = sizeof (struct sockaddr_in);
+ if ((ret = bind (src->sock.fd, (struct sockaddr *) &src->myaddr, len)) < 0)
goto bind_error;
len = sizeof (src->myaddr);