diff options
author | Daniel Franke <df@dfranke.us> | 2008-09-25 10:34:39 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2008-09-25 10:34:39 +0000 |
commit | edd6239979fafeaf9735effd452878d79ea5002c (patch) | |
tree | 6da26f29543fa85b65112f92cb82a9fbd08f44f3 /gst | |
parent | bf8777356bd15858d69d520b7134f20eeeded01c (diff) |
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.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/udp/gstudpsrc.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index ed0dbc0b..0f2af457 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); |