From 7d5d482411dc788377dc4ac74eadd3ee95dea278 Mon Sep 17 00:00:00 2001 From: Edgard Lima Date: Mon, 31 Oct 2005 14:41:31 +0000 Subject: [PATCH] Add checks to GST_FLOW_NOT_LINKED for values returned from gst_pad_push. Original commit message from CVS: Add checks to GST_FLOW_NOT_LINKED for values returned from gst_pad_push. --- ChangeLog | 6 ++++++ ext/speex/gstspeexenc.c | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4bde7cd566..8d8a8a843e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-10-31 Edgard Lima + + * 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 * gst/rtp/gstrtpg711dec.c: (gst_rtpg711dec_setcaps), diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index 8dea5a0736..b9e12b6f8d 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -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; } } }