return EOS instead of NULL
authorThomas Vander Stichele <thomas@apestaart.org>
Tue, 8 Jun 2004 14:45:33 +0000 (14:45 +0000)
committerThomas Vander Stichele <thomas@apestaart.org>
Tue, 8 Jun 2004 14:45:33 +0000 (14:45 +0000)
Original commit message from CVS:
return EOS instead of NULL

ChangeLog
gst/tcp/gsttcpclientsrc.c
gst/tcp/gsttcpserversrc.c

index e539525..83a6bdb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-08  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+       * gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_get):
+       * gst/tcp/gsttcpserversrc.c: (gst_tcpserversrc_get):
+          return EOS instead of NULL in _get
+
 2004-06-08  Wim Taymans  <wim@fluendo.com>
 
        * gst/tcp/gsttcp.c: (gst_tcp_gdp_read_header),
index 811242a..2b833ad 100644 (file)
@@ -221,7 +221,7 @@ gst_tcpclientsrc_get (GstPad * pad)
       if (ret <= 0) {
         GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
             ("select failed: %s", g_strerror (errno)));
-        return NULL;
+        return GST_DATA (gst_event_new (GST_EVENT_EOS));
       }
 
       /* ask how much is available for reading on the socket */
@@ -229,7 +229,7 @@ gst_tcpclientsrc_get (GstPad * pad)
       if (ret < 0) {
         GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
             ("ioctl failed: %s", g_strerror (errno)));
-        return NULL;
+        return GST_DATA (gst_event_new (GST_EVENT_EOS));
       }
       GST_LOG_OBJECT (src, "ioctl says %d bytes available", readsize);
       buf = gst_buffer_new_and_alloc (readsize);
@@ -242,7 +242,7 @@ gst_tcpclientsrc_get (GstPad * pad)
         if (!(caps = gst_tcp_gdp_read_caps (GST_ELEMENT (src), src->sock_fd))) {
           GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
               ("Could not read caps through GDP"));
-          return NULL;
+          return GST_DATA (gst_event_new (GST_EVENT_EOS));
         }
         src->caps_received = TRUE;
         string = gst_caps_to_string (caps);
@@ -251,7 +251,7 @@ gst_tcpclientsrc_get (GstPad * pad)
 
         if (!gst_pad_try_set_caps (pad, caps)) {
           g_warning ("Could not set caps");
-          return NULL;
+          return GST_DATA (gst_event_new (GST_EVENT_EOS));
         }
       }
 
@@ -259,7 +259,7 @@ gst_tcpclientsrc_get (GstPad * pad)
       if (!(data = gst_tcp_gdp_read_header (GST_ELEMENT (src), src->sock_fd))) {
         GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
             ("Could not read data header through GDP"));
-        return NULL;
+        return GST_DATA (gst_event_new (GST_EVENT_EOS));
       }
       if (GST_IS_EVENT (data))
         return data;
@@ -280,7 +280,7 @@ gst_tcpclientsrc_get (GstPad * pad)
   if (ret < 0) {
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM);
     gst_buffer_unref (buf);
-    return NULL;
+    return GST_DATA (gst_event_new (GST_EVENT_EOS));
   }
 
   /* if we read 0 bytes, and we're blocking, we hit eos */
@@ -335,7 +335,6 @@ gst_tcpclientsrc_get (GstPad * pad)
   return GST_DATA (buf);
 }
 
-
 static void
 gst_tcpclientsrc_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec)
index 647764f..115a330 100644 (file)
@@ -317,14 +317,14 @@ gst_tcpserversrc_get (GstPad * pad)
       if (ret <= 0) {
         GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
             ("select failed: %s", g_strerror (errno)));
-        return NULL;
+        return GST_DATA (gst_event_new (GST_EVENT_EOS));
       }
       /* ask how much is available for reading on the socket */
       ret = ioctl (src->client_sock_fd, FIONREAD, &readsize);
       if (ret < 0) {
         GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
             ("ioctl failed: %s", g_strerror (errno)));
-        return NULL;
+        return GST_DATA (gst_event_new (GST_EVENT_EOS));
       }
 
       buf = gst_buffer_new_and_alloc (readsize);
@@ -337,7 +337,7 @@ gst_tcpserversrc_get (GstPad * pad)
         if (!(caps = gst_tcpserversrc_gdp_read_caps (src))) {
           GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
               ("Could not read caps through GDP"));
-          return NULL;
+          return GST_DATA (gst_event_new (GST_EVENT_EOS));
         }
         src->caps_received = TRUE;
         string = gst_caps_to_string (caps);
@@ -346,7 +346,7 @@ gst_tcpserversrc_get (GstPad * pad)
 
         if (!gst_pad_try_set_caps (pad, caps)) {
           g_warning ("Could not set caps");
-          return NULL;
+          return GST_DATA (gst_event_new (GST_EVENT_EOS));
         }
       }
 
@@ -354,7 +354,7 @@ gst_tcpserversrc_get (GstPad * pad)
       if (!(data = gst_tcpserversrc_gdp_read_header (src))) {
         GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
             ("Could not read data header through GDP"));
-        return NULL;
+        return GST_DATA (gst_event_new (GST_EVENT_EOS));
       }
       if (GST_IS_EVENT (data))
         return data;
@@ -377,7 +377,7 @@ gst_tcpserversrc_get (GstPad * pad)
   if (ret < 0) {
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM);
     gst_buffer_unref (buf);
-    return NULL;
+    return GST_DATA (gst_event_new (GST_EVENT_EOS));
   }
 
   /* if we read 0 bytes, and we're blocking, we hit eos */