Add checks to GST_FLOW_NOT_LINKED for values returned from gst_pad_push.
authorEdgard Lima <edgard.lima@indt.org.br>
Mon, 31 Oct 2005 14:41:31 +0000 (14:41 +0000)
committerEdgard Lima <edgard.lima@indt.org.br>
Mon, 31 Oct 2005 14:41:31 +0000 (14:41 +0000)
Original commit message from CVS:
Add checks to GST_FLOW_NOT_LINKED for values returned from gst_pad_push.

ChangeLog
ext/speex/gstspeexenc.c

index 4bde7cd..8d8a8a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-31  Edgard Lima <edgard.lima@indt.org.br>
+
+       * ext/speex/gstspeexenc.c: (gst_speexenc_chain)
+       Add checks to GST_FLOW_NOT_LINKED for values returned
+       from gst_pad_push.
+       
 2005-10-31  Zeeshan Ali  <zeenix@gmail.com>
 
        * gst/rtp/gstrtpg711dec.c: (gst_rtpg711dec_setcaps),
index 8dea5a0..b9e12b6 100644 (file)
@@ -940,12 +940,17 @@ gst_speexenc_chain (GstPad * pad, GstBuffer * buf)
     gst_buffer_set_caps (buf2, caps);
 
     /* push out buffers */
-    if (GST_FLOW_OK != (ret = gst_speexenc_push_buffer (speexenc, buf1))) {
+    ret = gst_speexenc_push_buffer (speexenc, buf1);
+
+    if ((GST_FLOW_OK != ret) && (GST_FLOW_NOT_LINKED != ret)) {
       gst_buffer_unref (buf1);
       goto error;
     }
 
-    if (GST_FLOW_OK != (ret = gst_speexenc_push_buffer (speexenc, buf2))) {
+    ret = gst_speexenc_push_buffer (speexenc, buf2);
+
+    if ((GST_FLOW_OK != ret) && (GST_FLOW_NOT_LINKED != ret)) {
+
       gst_buffer_unref (buf2);
       goto error;
     }
@@ -995,7 +1000,7 @@ gst_speexenc_chain (GstPad * pad, GstBuffer * buf)
           GST_BUFFER_OFFSET_NONE, outsize, GST_PAD_CAPS (speexenc->srcpad),
           &outbuf);
 
-      if (GST_FLOW_OK != ret) {
+      if ((GST_FLOW_OK != ret)) {
         goto error;
       }
 
@@ -1012,10 +1017,11 @@ gst_speexenc_chain (GstPad * pad, GstBuffer * buf)
       GST_BUFFER_OFFSET_END (outbuf) =
           speexenc->frameno * frame_size - speexenc->lookahead;
 
-      if (GST_FLOW_OK != (ret = gst_speexenc_push_buffer (speexenc, outbuf))) {
-        printf ("ret = %d\n", ret);
-        // gst_buffer_unref(outbuf);
-        //      goto error;
+      ret = gst_speexenc_push_buffer (speexenc, outbuf);
+
+      if ((GST_FLOW_OK != ret) && (GST_FLOW_NOT_LINKED != ret)) {
+        gst_buffer_unref (outbuf);
+        goto error;
       }
     }
   }