summaryrefslogtreecommitdiffstats
path: root/ext/speex
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-03-13 15:49:08 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-03-13 15:49:08 +0000
commit8a51401ef61672335deec8d55dfd421c06887783 (patch)
tree37e2f96f15d4238ff7126c968e91d20a2dd9b344 /ext/speex
parentb6fc5016695a8234ff2deb78bfa8addd0e8631f4 (diff)
close #333784 unref the result of gst_pad_get_parent() by: Christophe Fergeau.
Original commit message from CVS: * ext/cairo/gsttextoverlay.c: (gst_text_overlay_setcaps): * ext/esd/esdmon.c: (gst_esdmon_get): * ext/flac/gstflactag.c: (gst_flac_tag_chain): * ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_sink_setcaps), (gst_gdk_pixbuf_sink_getcaps): * ext/jpeg/gstjpegenc.c: (gst_jpegenc_getcaps), (gst_jpegenc_setcaps): * ext/jpeg/gstsmokedec.c: (gst_smokedec_chain): * ext/jpeg/gstsmokeenc.c: (gst_smokeenc_getcaps), (gst_smokeenc_setcaps): * ext/libmng/gstmngdec.c: (gst_mngdec_sinklink), (gst_mngdec_src_getcaps): * ext/libmng/gstmngenc.c: (gst_mngenc_sinklink), (gst_mngenc_chain): * ext/libpng/gstpngenc.c: (gst_pngenc_setcaps): * ext/mikmod/gstmikmod.c: (gst_mikmod_srclink): * ext/speex/gstspeexdec.c: (speex_dec_convert), (speex_dec_src_event), (speex_dec_chain): * gst/avi/gstavimux.c: (gst_avimux_vidsinkconnect), (gst_avimux_audsinkconnect), (gst_avimux_handle_event): * gst/debug/negotiation.c: (gst_negotiation_getcaps), (gst_negotiation_pad_link), (gst_negotiation_chain): * gst/flx/gstflxdec.c: (gst_flxdec_src_query_handler), (gst_flxdec_chain): * gst/interleave/deinterleave.c: (deinterleave_sink_link), (deinterleave_chain): * gst/law/mulaw-encode.c: (mulawenc_setcaps): * gst/median/gstmedian.c: (gst_median_link): * gst/monoscope/gstmonoscope.c: (gst_monoscope_srcconnect), (gst_monoscope_chain): * gst/rtp/gstrtpL16pay.c: (gst_rtpL16pay_sinkconnect): * gst/wavenc/gstwavenc.c: (gst_wavenc_sink_setcaps): * sys/osxaudio/gstosxaudiosink.c: (gst_osxaudiosink_chain): * sys/osxaudio/gstosxaudiosrc.c: (gst_osxaudiosrc_get): close #333784 unref the result of gst_pad_get_parent() by: Christophe Fergeau.
Diffstat (limited to 'ext/speex')
-rw-r--r--ext/speex/gstspeexdec.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c
index 5bf95818..d213f9b3 100644
--- a/ext/speex/gstspeexdec.c
+++ b/ext/speex/gstspeexdec.c
@@ -158,12 +158,16 @@ speex_dec_convert (GstPad * pad,
dec = GST_SPEEXDEC (gst_pad_get_parent (pad));
- if (dec->packetno < 1)
- return FALSE;
+ if (dec->packetno < 1) {
+ res = FALSE;
+ goto cleanup;
+ }
if (pad == dec->sinkpad &&
- (src_format == GST_FORMAT_BYTES || *dest_format == GST_FORMAT_BYTES))
- return FALSE;
+ (src_format == GST_FORMAT_BYTES || *dest_format == GST_FORMAT_BYTES)) {
+ res = FALSE;
+ goto cleanup;
+ }
switch (src_format) {
case GST_FORMAT_TIME:
@@ -206,6 +210,8 @@ speex_dec_convert (GstPad * pad,
res = FALSE;
}
+cleanup:
+ gst_object_unref (dec);
return res;
}
@@ -289,6 +295,8 @@ speex_dec_src_event (GstPad * pad, GstEvent * event)
break;
}
+ gst_object_unref (dec);
+
return res;
}
@@ -350,6 +358,7 @@ speex_dec_chain (GstPad * pad, GstBuffer * buf)
{
GstFlowReturn res;
GstSpeexDec *dec;
+ GstFlowReturn result;
dec = GST_SPEEXDEC (gst_pad_get_parent (pad));
@@ -363,14 +372,16 @@ speex_dec_chain (GstPad * pad, GstBuffer * buf)
if (!dec->header) {
GST_ELEMENT_ERROR (GST_ELEMENT (dec), STREAM, DECODE,
(NULL), ("couldn't read header"));
- return GST_FLOW_ERROR;
+ result = GST_FLOW_ERROR;
+ goto cleanup;
}
if (dec->header->mode >= SPEEX_NB_MODES) {
GST_ELEMENT_ERROR (GST_ELEMENT (dec), STREAM, DECODE,
(NULL),
("Mode number %d does not (yet/any longer) exist in this version",
dec->header->mode));
- return GST_FLOW_ERROR;
+ result = GST_FLOW_ERROR;
+ goto cleanup;
}
dec->mode = (SpeexMode *) speex_mode_list[dec->header->mode];
@@ -381,7 +392,8 @@ speex_dec_chain (GstPad * pad, GstBuffer * buf)
GST_ELEMENT_ERROR (GST_ELEMENT (dec), STREAM, DECODE,
(NULL), ("couldn't initialize decoder"));
gst_buffer_unref (buf);
- return GST_FLOW_ERROR;
+ result = GST_FLOW_ERROR;
+ goto cleanup;
}
speex_decoder_ctl (dec->state, SPEEX_SET_ENH, &dec->enh);
@@ -408,7 +420,8 @@ speex_dec_chain (GstPad * pad, GstBuffer * buf)
if (!gst_pad_set_caps (dec->srcpad, caps)) {
gst_caps_unref (caps);
- return GST_FLOW_NOT_NEGOTIATED;
+ result = GST_FLOW_NOT_NEGOTIATED;
+ goto cleanup;
}
gst_caps_unref (caps);
gst_pad_push_event (dec->srcpad,
@@ -511,8 +524,12 @@ speex_dec_chain (GstPad * pad, GstBuffer * buf)
}
}
dec->packetno++;
+ result = GST_FLOW_OK;
+
+cleanup:
+ gst_object_unref (dec);
- return GST_FLOW_OK;
+ return result;
}
static void