diff options
author | Edgard Lima <edgard.lima@indt.org.br> | 2005-10-31 14:41:31 +0000 |
---|---|---|
committer | Edgard Lima <edgard.lima@indt.org.br> | 2005-10-31 14:41:31 +0000 |
commit | 7d5d482411dc788377dc4ac74eadd3ee95dea278 (patch) | |
tree | e11db94a6a25776541799e7f582f16da1d9ed12c /ext/speex | |
parent | 6662f94650e100f28209830fd3b13b0ad7d6f1c9 (diff) |
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.
Diffstat (limited to 'ext/speex')
-rw-r--r-- | ext/speex/gstspeexenc.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index 8dea5a07..b9e12b6f 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; } } } |