summaryrefslogtreecommitdiffstats
path: root/ext/gsm/gstgsmenc.c
diff options
context:
space:
mode:
authorZeeshan Ali <zeenix@gmail.com>2005-10-26 15:45:11 +0000
committerZeeshan Ali <zeenix@gmail.com>2005-10-26 15:45:11 +0000
commit72818f871d003b3b08ee75fcf59c03d1de608a99 (patch)
tree3c1f7d58beb8c71bef1a0b1e067391dba0ea6163 /ext/gsm/gstgsmenc.c
parentd6f4ad6163568ee4b77e3056a6277575951a2f5e (diff)
downloadgst-plugins-bad-72818f871d003b3b08ee75fcf59c03d1de608a99.tar.gz
gst-plugins-bad-72818f871d003b3b08ee75fcf59c03d1de608a99.tar.bz2
gst-plugins-bad-72818f871d003b3b08ee75fcf59c03d1de608a99.zip
Fixing stuff as wingo pointed out.
Original commit message from CVS: Fixing stuff as wingo pointed out.
Diffstat (limited to 'ext/gsm/gstgsmenc.c')
-rw-r--r--ext/gsm/gstgsmenc.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/ext/gsm/gstgsmenc.c b/ext/gsm/gstgsmenc.c
index c4a39e46..2ecbefc7 100644
--- a/ext/gsm/gstgsmenc.c
+++ b/ext/gsm/gstgsmenc.c
@@ -158,18 +158,12 @@ gst_gsmenc_chain (GstPad * pad, GstBuffer * buf)
{
GstGSMEnc *gsmenc;
gsm_signal *data;
-
- g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
+ GstFlowReturn ret = GST_FLOW_OK;
gsmenc = GST_GSMENC (gst_pad_get_parent (pad));
- g_return_val_if_fail (GST_IS_GSMENC (gsmenc), GST_FLOW_ERROR);
-
- g_return_val_if_fail (GST_PAD_IS_LINKED (gsmenc->srcpad), GST_FLOW_ERROR);
-
gst_adapter_push (gsmenc->adapter, buf);
while (gst_adapter_available (gsmenc->adapter) >= 320) {
-
GstBuffer *outbuf;
outbuf = gst_buffer_new_and_alloc (33 * sizeof (gsm_byte));
@@ -185,8 +179,10 @@ gst_gsmenc_chain (GstPad * pad, GstBuffer * buf)
gst_buffer_set_caps (outbuf, gst_pad_get_caps (gsmenc->srcpad));
GST_DEBUG ("Pushing buffer of size %d", GST_BUFFER_SIZE (outbuf));
//gst_util_dump_mem (GST_BUFFER_DATA(outbuf), GST_BUFFER_SIZE (outbuf));
- gst_pad_push (gsmenc->srcpad, outbuf);
+ ret = gst_pad_push (gsmenc->srcpad, outbuf);
}
- return GST_FLOW_OK;
+ gst_object_unref (gsmenc);
+
+ return ret;
}