From: <wt...@ke...> - 2008-09-25 10:34:59
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: wtay Date: Thu Sep 25 2008 10:34:53 UTC Log message: 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. Modified files: . : ChangeLog gst/udp : gstudpsrc.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3739&r2=1.3740 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstudpsrc.c.diff?r1=1.92&r2=1.93 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.3739 retrieving revision 1.3740 diff -u -d -r1.3739 -r1.3740 --- ChangeLog 23 Sep 2008 18:08:55 -0000 1.3739 +++ ChangeLog 25 Sep 2008 10:34:37 -0000 1.3740 @@ -1,3 +1,12 @@ +2008-09-25 Wim Taymans <wim...@co...> + + 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...@co...> * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_open): Index: gstudpsrc.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstudpsrc.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- gstudpsrc.c 20 Aug 2008 11:51:38 -0000 1.92 +++ gstudpsrc.c 25 Sep 2008 10:34:39 -0000 1.93 @@ -376,26 +376,18 @@ 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 @@ 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); |