gst/synaesthesia/gstsynaesthesia.c: check result of gst_pad_push() in _chain.
authorStefan Kost <ensonic@users.sourceforge.net>
Fri, 9 Feb 2007 08:03:09 +0000 (08:03 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Fri, 9 Feb 2007 08:03:09 +0000 (08:03 +0000)
Original commit message from CVS:
* gst/synaesthesia/gstsynaesthesia.c:
(gst_synaesthesia_class_init), (gst_synaesthesia_init),
(gst_synaesthesia_sink_setcaps), (gst_synaesthesia_src_getcaps),
(gst_synaesthesia_chain), (plugin_init):
check result of gst_pad_push() in _chain.

ChangeLog
gst/synaesthesia/gstsynaesthesia.c

index f8b95b68497f726b1d89af18b38846e41bc5090a..e2555ac7429298b314921773a12703e15079cfce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-02-09  Stefan Kost  <ensonic@users.sf.net>
+
+       * gst/synaesthesia/gstsynaesthesia.c:
+       (gst_synaesthesia_class_init), (gst_synaesthesia_init),
+       (gst_synaesthesia_sink_setcaps), (gst_synaesthesia_src_getcaps),
+       (gst_synaesthesia_chain), (plugin_init):
+         check result of gst_pad_push() in _chain.
+
 2007-02-09  Stefan Kost  <ensonic@users.sf.net>
 
        * gst/synaesthesia/Makefile.am:
index e55e9e177a34713fdedb4319964a78da5b8b5244..fe5f668c04b46a79cda9aaf8892d8e288f0b5bf1 100644 (file)
@@ -412,30 +412,34 @@ gst_synaesthesia_chain (GstPad * pad, GstBuffer * buffer)
 
     ret =
         gst_pad_alloc_buffer_and_set_caps (synaesthesia->srcpad,
-        GST_BUFFER_OFFSET_NONE, synaesthesia->width * synaesthesia->height * 4,
+        GST_BUFFER_OFFSET_NONE,
+        synaesthesia->width * synaesthesia->height * 4,
         GST_PAD_CAPS (synaesthesia->srcpad), &outbuf);
 
     /* no buffer allocated, we don't care why. */
     if (ret != GST_FLOW_OK)
-      goto done;
+      break;
 
     GST_BUFFER_TIMESTAMP (outbuf) =
         synaesthesia->audio_basetime +
         (GST_SECOND * synaesthesia->samples_consumed /
         synaesthesia->sample_rate);
     GST_BUFFER_DURATION (outbuf) = frame_duration;
-    GST_BUFFER_SIZE (outbuf) = synaesthesia->width * synaesthesia->height * 4;
 
     out_frame = (guchar *) synaesthesia_update (synaesthesia->datain);
     memcpy (GST_BUFFER_DATA (outbuf), out_frame, GST_BUFFER_SIZE (outbuf));
-    gst_pad_push (synaesthesia->srcpad, outbuf);
+
+    ret = gst_pad_push (synaesthesia->srcpad, outbuf);
+    outbuf = NULL;
+
+    if (ret != GST_FLOW_OK)
+      break;
 
     synaesthesia->samples_consumed += samples_per_frame;
     gst_adapter_flush (synaesthesia->adapter, samples_per_frame *
         synaesthesia->channels * sizeof (gint16));
   }
 
-done:
   gst_object_unref (synaesthesia);
 
   return ret;