CVS Root: /cvs/gstreamer
Module: gst-plugins-good
Changes by: msmith
Date: Thu Nov 20 2008 22:57:12 UTC
Log message:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpnetutils.c:
* gst/udp/gstudpnetutils.h:
* gst/udp/gstudpsrc.c:
Fix multiudpsink on OSX by passing the specific length of the socket,
refactor that into a function shared with the same thing in udpsrc.
Modified files:
. : ChangeLog
gst/udp : gstmultiudpsink.c gstudpnetutils.c
gstudpnetutils.h gstudpsrc.c
Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3824&r2=1.3825
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.c.diff?r1=1.39&r2=1.40
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstudpnetutils.c.diff?r1=1.7&r2=1.8
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstudpnetutils.h.diff?r1=1.5&r2=1.6
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstudpsrc.c.diff?r1=1.95&r2=1.96
====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v
retrieving revision 1.3824
retrieving revision 1.3825
diff -u -d -r1.3824 -r1.3825
--- ChangeLog 20 Nov 2008 20:07:24 -0000 1.3824
+++ ChangeLog 20 Nov 2008 22:56:55 -0000 1.3825
@@ -1,3 +1,12 @@
+2008-11-20 Michael Smith <[email protected]>
+
+ * gst/udp/gstmultiudpsink.c:
+ * gst/udp/gstudpnetutils.c:
+ * gst/udp/gstudpnetutils.h:
+ * gst/udp/gstudpsrc.c:
+ Fix multiudpsink on OSX by passing the specific length of the socket,
+ refactor that into a function shared with the same thing in udpsrc.
2008-11-20 Wim Taymans <[email protected]>
* gst/wavparse/gstwavparse.c: (uint64_ceiling_scale_int),
Index: gstmultiudpsink.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- gstmultiudpsink.c 27 Oct 2008 08:36:42 -0000 1.39
+++ gstmultiudpsink.c 20 Nov 2008 22:56:57 -0000 1.40
@@ -374,6 +374,7 @@
gint ret, size, num = 0;
guint8 *data;
GList *clients;
+ gint len;
sink = GST_MULTIUDPSINK (bsink);
@@ -395,12 +396,13 @@
GST_LOG_OBJECT (sink, "sending %d bytes to client %p", size, client);
while (TRUE) {
+ len = gst_udp_get_sockaddr_length (&client->theiraddr);
#ifdef G_OS_WIN32
ret = sendto (*client->sock, (char *) data, size, 0,
#else
ret = sendto (*client->sock, data, size, 0,
#endif
- (struct sockaddr *) &client->theiraddr, sizeof (client->theiraddr));
+ (struct sockaddr *) &client->theiraddr, len);
if (ret < 0) {
/* we get a non-posix EPERM on Linux when a firewall rule blocks this
* destination. We will simply ignore this. */
Index: gstudpnetutils.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstudpnetutils.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- gstudpnetutils.c 23 Jul 2008 22:01:20 -0000 1.7
+++ gstudpnetutils.c 20 Nov 2008 22:56:57 -0000 1.8
@@ -60,6 +60,23 @@
int
+gst_udp_get_sockaddr_length (struct sockaddr_storage *addr)
+{
+ /* MacOS is picky about passing precisely the correct length,
+ * so we calculate it here for the given socket type.
+ */
+ switch (addr->ss_family) {
+ case AF_INET:
+ return sizeof (struct sockaddr_in);
+ case AF_INET6:
+ return sizeof (struct sockaddr_in6);
+ default:
+ /* don't know, Screw MacOS and use the full length */
+ return sizeof (*addr);
+ }
+}
+int
gst_udp_get_addr (const char *hostname, int port, struct sockaddr_storage *addr)
{
struct addrinfo hints, *res, *nres;
Index: gstudpnetutils.h
RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstudpnetutils.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gstudpnetutils.h 27 Oct 2008 08:40:02 -0000 1.5
+++ gstudpnetutils.h 20 Nov 2008 22:56:57 -0000 1.6
@@ -74,6 +74,8 @@
+int gst_udp_get_sockaddr_length(struct sockaddr_storage *addr);
int gst_udp_get_addr (const char *hostname, int port, struct sockaddr_storage *addr);
int gst_udp_is_multicast (struct sockaddr_storage *addr);
Index: gstudpsrc.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstudpsrc.c,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -d -r1.95 -r1.96
--- gstudpsrc.c 27 Oct 2008 08:36:43 -0000 1.95
+++ gstudpsrc.c 20 Nov 2008 22:56:58 -0000 1.96
@@ -777,19 +777,7 @@
GST_DEBUG_OBJECT (src, "binding on port %d", src->port);
- /* Mac OS is picky about the size for the bind so we switch on the family */
- switch (src->myaddr.ss_family) {
- case AF_INET:
- len = sizeof (struct sockaddr_in);
- break;
- case AF_INET6:
- len = sizeof (struct sockaddr_in6);
- default:
- /* don't know, Screw MacOS and use the full length */
- len = sizeof (src->myaddr);
- }
+ len = gst_udp_get_sockaddr_length (&src->myaddr);
if ((ret = bind (src->sock.fd, (struct sockaddr *) &src->myaddr, len)) < 0)
goto bind_error;
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.