wtay gst-plugins-good: gst-plugins-good/ gst-plugins-good/gst/udp/

[email protected]
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-plugins-good
Changes by:     wtay
Date:           Fri Nov 28 2008  15:11:04 UTC

Log message:
Patch by: Peter Kjellerstedt <pkj at axis com>
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_render):
Make gst_multiudpsink_render() ignore errors from sendto() instead of
breaking streaming. Emit a warning instead. Fixes #562572.

Modified files:
    .               : ChangeLog
    gst/udp         : gstmultiudpsink.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3840&r2=1.3841
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.c.diff?r1=1.40&r2=1.41

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v
retrieving revision 1.3840
retrieving revision 1.3841
diff -u -d -r1.3840 -r1.3841
--- ChangeLog	27 Nov 2008 16:43:22 -0000	1.3840
+++ ChangeLog	28 Nov 2008 15:10:48 -0000	1.3841
@@ -1,3 +1,11 @@
+2008-11-28  Wim Taymans  <[email protected]>
+
+	Patch by: Peter Kjellerstedt <pkj at axis com>
+	* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_render):
+	Make gst_multiudpsink_render() ignore errors from sendto() instead of
+	breaking streaming. Emit a warning instead. Fixes #562572.
 2008-11-27  Sebastian Dröge  <[email protected]>
 
 	Patch by: Ron McOuat <rmcouat at smartt dot com>
Index: gstmultiudpsink.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- gstmultiudpsink.c	20 Nov 2008 22:56:57 -0000	1.40
+++ gstmultiudpsink.c	28 Nov 2008 15:10:50 -0000	1.41
@@ -371,7 +371,7 @@
 gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
 {
   GstMultiUDPSink *sink;
-  gint ret, size, num = 0;
+  gint ret, size, num = 0, no_clients = 0;
   guint8 *data;
   GList *clients;
   gint len;
@@ -392,26 +392,30 @@
     GstUDPClient *client;
     client = (GstUDPClient *) clients->data;
-    num++;
+    no_clients++;
     GST_LOG_OBJECT (sink, "sending %d bytes to client %p", size, client);
     while (TRUE) {
       len = gst_udp_get_sockaddr_length (&client->theiraddr);
+      ret = sendto (*client->sock,
 #ifdef G_OS_WIN32
-      ret = sendto (*client->sock, (char *) data, size, 0,
+          (char *) data,
 #else
-      ret = sendto (*client->sock, data, size, 0,
+          data,
 #endif
-          (struct sockaddr *) &client->theiraddr, len);
+          size, 0, (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. */
-        if (errno == EPERM)
-          break;
+        /* some error, just warn, it's likely recoverable and we don't want to
+         * break streaming. We break so that we stop retrying for this client. */
         if (errno != EINTR && errno != EAGAIN) {
-          goto send_error;
+          GST_WARNING_OBJECT (sink, "client %p gave error %d (%s)", errno,
+              g_strerror (errno));
+          break;
         }
       } else {
+        num++;
         client->bytes_sent += ret;
         client->packets_sent++;
         sink->bytes_served += ret;
@@ -421,20 +425,10 @@
   }
   g_mutex_unlock (sink->client_lock);
-  GST_LOG_OBJECT (sink, "sent %d bytes to %d clients", size, num);
+  GST_LOG_OBJECT (sink, "sent %d bytes to %d (of %d) clients", size, num,
+      no_clients);
   return GST_FLOW_OK;
-
-  /* ERRORS */
-send_error:
-  {
-    /* if sendto returns an error, something is seriously wrong */
-    g_mutex_unlock (sink->client_lock);
-    GST_DEBUG_OBJECT (sink, "got send error %d: %s", errno, g_strerror (errno));
-    GST_ELEMENT_ERROR (sink, STREAM, FAILED, (NULL),
-        ("Got send error %d: %s", errno, g_strerror (errno)));
-    return GST_FLOW_ERROR;
-  }
 }
 static void

-------------------------------------------------------------------------
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=/

_______________________________________________
gstreamer-cvs-verbose mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gstreamer-cvs-verbose
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.