From 8a51401ef61672335deec8d55dfd421c06887783 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 13 Mar 2006 15:49:08 +0000 Subject: 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. --- ChangeLog | 39 +++++++++++++++++++++++++++++++++++++++ ext/cairo/gsttextoverlay.c | 2 ++ ext/esd/esdmon.c | 1 + ext/flac/gstflactag.c | 18 ++++++++++-------- ext/gdk_pixbuf/gstgdkpixbuf.c | 3 ++- ext/jpeg/gstjpegenc.c | 3 +++ ext/jpeg/gstsmokedec.c | 3 ++- ext/jpeg/gstsmokeenc.c | 4 ++++ ext/libmng/gstmngdec.c | 3 +++ ext/libmng/gstmngenc.c | 7 ++++++- ext/libpng/gstpngenc.c | 3 +++ ext/mikmod/gstmikmod.c | 10 +++++++++- ext/speex/gstspeexdec.c | 35 ++++++++++++++++++++++++++--------- gst/avi/gstavimux.c | 13 ++++++++++++- gst/debug/negotiation.c | 3 +++ gst/flx/gstflxdec.c | 3 ++- gst/law/mulaw-encode.c | 1 + gst/median/gstmedian.c | 2 ++ gst/monoscope/gstmonoscope.c | 5 +++++ gst/rtp/gstrtpL16pay.c | 6 +++++- gst/wavenc/gstwavenc.c | 3 +++ sys/osxaudio/gstosxaudiosink.c | 3 +++ sys/osxaudio/gstosxaudiosrc.c | 4 ++++ 23 files changed, 150 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index fee8adb7..e5f4b100 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,42 @@ +2006-03-13 Wim Taymans + + * 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. + 2006-03-09 Wim Taymans * ext/dv/gstdvdemux.c: (gst_dvdemux_handle_sink_event), diff --git a/ext/cairo/gsttextoverlay.c b/ext/cairo/gsttextoverlay.c index 2fd8dc85..34137ad9 100644 --- a/ext/cairo/gsttextoverlay.c +++ b/ext/cairo/gsttextoverlay.c @@ -556,6 +556,8 @@ gst_text_overlay_setcaps (GstPad * pad, GstCaps * caps) overlay->fps_n = gst_value_get_fraction_numerator (fps); overlay->fps_d = gst_value_get_fraction_denominator (fps); + gst_object_unref (overlay); + return ret; } diff --git a/ext/esd/esdmon.c b/ext/esd/esdmon.c index 58111057..f69e0cad 100644 --- a/ext/esd/esdmon.c +++ b/ext/esd/esdmon.c @@ -277,6 +277,7 @@ gst_esdmon_get (GstPad * pad) GST_DEBUG ("pushed buffer from esdmon of %ld bytes, timestamp %" G_GINT64_FORMAT, readbytes, GST_BUFFER_TIMESTAMP (buf)); + gst_object_unref (esdmon); return GST_DATA (buf); } diff --git a/ext/flac/gstflactag.c b/ext/flac/gstflactag.c index ffb435d2..c3f23705 100644 --- a/ext/flac/gstflactag.c +++ b/ext/flac/gstflactag.c @@ -289,11 +289,11 @@ gst_flac_tag_chain (GstPad * pad, GstData * data) /* Initial state, we don't even know if we are dealing with a flac file */ if (tag->state == GST_FLAC_TAG_STATE_INIT) { if (!caps_nego (tag)) { - return; + goto cleanup; } if (GST_BUFFER_SIZE (tag->buffer) < sizeof (FLAC_MAGIC)) { - return; + goto cleanup; } if (strncmp (GST_BUFFER_DATA (tag->buffer), FLAC_MAGIC, @@ -337,7 +337,7 @@ gst_flac_tag_chain (GstPad * pad, GstData * data) * 24 next bits: size of the metadata to follow (big endian) */ if (GST_BUFFER_SIZE (tag->buffer) < 4) { - return; + goto cleanup; } is_last = (((GST_BUFFER_DATA (tag->buffer)[0]) & 0x80) == 0x80); /* If we have metadata set on the element, the last metadata block @@ -443,7 +443,7 @@ gst_flac_tag_chain (GstPad * pad, GstData * data) if (tag->only_output_tags) { send_eos (tag); - return; + goto cleanup; } } @@ -456,7 +456,7 @@ gst_flac_tag_chain (GstPad * pad, GstData * data) * metadata, so just stop now */ send_eos (tag); - return; + goto cleanup; } else { tag->state = GST_FLAC_TAG_STATE_ADD_VORBIS_COMMENT; } @@ -507,7 +507,7 @@ gst_flac_tag_chain (GstPad * pad, GstData * data) if (buffer == NULL) { GST_ELEMENT_ERROR (tag, CORE, TAG, (NULL), ("Error converting tag list to vorbiscomment buffer")); - return; + goto cleanup; } size = GST_BUFFER_SIZE (buffer) - 4; if ((size > 0xFFFFFF) || (size < 0)) { @@ -517,7 +517,7 @@ gst_flac_tag_chain (GstPad * pad, GstData * data) */ GST_ELEMENT_ERROR (tag, CORE, TAG, (NULL), ("Vorbis comment of size %d too long", size)); - return; + goto cleanup; } /* Get rid of the framing bit at the end of the vorbiscomment buffer @@ -545,12 +545,14 @@ gst_flac_tag_chain (GstPad * pad, GstData * data) tag->state = GST_FLAC_TAG_STATE_AUDIO_DATA; } - /* The metadata blocks have been read, now we are reading audio data */ if (tag->state == GST_FLAC_TAG_STATE_AUDIO_DATA) { gst_pad_push (tag->srcpad, GST_DATA (tag->buffer)); tag->buffer = NULL; } + +cleanup: + gst_object_unref (tag); } diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c index 34dcae94..3ddf1d2e 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.c +++ b/ext/gdk_pixbuf/gstgdkpixbuf.c @@ -126,7 +126,7 @@ GST_BOILERPLATE (GstGdkPixbuf, gst_gdk_pixbuf, GstElement, GST_TYPE_ELEMENT) GST_DEBUG ("got framerate of %d/%d fps => packetized mode", filter->framerate_numerator, filter->framerate_denominator); } - + gst_object_unref (filter); return TRUE; } @@ -184,6 +184,7 @@ gst_gdk_pixbuf_sink_getcaps (GstPad * pad) filter = GST_GDK_PIXBUF (gst_pad_get_parent (pad)); g_return_val_if_fail (filter != NULL, NULL); g_return_val_if_fail (GST_IS_GDK_PIXBUF (filter), NULL); + gst_object_unref (filter); return gst_gdk_pixbuf_get_capslist (); } diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index 2485d2f6..b76b6205 100644 --- a/ext/jpeg/gstjpegenc.c +++ b/ext/jpeg/gstjpegenc.c @@ -280,6 +280,7 @@ gst_jpegenc_getcaps (GstPad * pad) GST_STR_FOURCC ("I420"), NULL); } } + gst_object_unref (jpegenc); return caps; } @@ -322,6 +323,8 @@ gst_jpegenc_setcaps (GstPad * pad, GstCaps * caps) gst_jpegenc_resync (jpegenc); } + gst_object_unref (jpegenc); + return ret; } diff --git a/ext/jpeg/gstsmokedec.c b/ext/jpeg/gstsmokedec.c index 88fa726f..72ed8fe0 100644 --- a/ext/jpeg/gstsmokedec.c +++ b/ext/jpeg/gstsmokedec.c @@ -183,7 +183,8 @@ gst_smokedec_chain (GstPad * pad, GstBuffer * buf) if (smokeret != SMOKECODEC_OK) goto header_error; - return GST_FLOW_OK; + ret = GST_FLOW_OK; + goto done; } /* now handle data packets */ diff --git a/ext/jpeg/gstsmokeenc.c b/ext/jpeg/gstsmokeenc.c index 392f0a88..cd499f85 100644 --- a/ext/jpeg/gstsmokeenc.c +++ b/ext/jpeg/gstsmokeenc.c @@ -228,6 +228,8 @@ gst_smokeenc_getcaps (GstPad * pad) } } + gst_object_unref (smokeenc); + return caps; } @@ -270,6 +272,8 @@ gst_smokeenc_setcaps (GstPad * pad, GstCaps * caps) gst_smokeenc_resync (smokeenc); } + gst_object_unref (smokeenc); + return ret; } diff --git a/ext/libmng/gstmngdec.c b/ext/libmng/gstmngdec.c index bd223a4d..dab5c044 100644 --- a/ext/libmng/gstmngdec.c +++ b/ext/libmng/gstmngdec.c @@ -141,6 +141,7 @@ gst_mngdec_sinklink (GstPad * pad, const GstCaps * caps) structure = gst_caps_get_structure (caps, 0); gst_structure_get_double (structure, "framerate", &mngdec->fps); + gst_object_unref (mngdec); return TRUE; } @@ -227,6 +228,8 @@ gst_mngdec_src_getcaps (GstPad * pad) } } + gst_object_unref (mngdec); + return caps; } diff --git a/ext/libmng/gstmngenc.c b/ext/libmng/gstmngenc.c index d52f6a40..320d314e 100644 --- a/ext/libmng/gstmngenc.c +++ b/ext/libmng/gstmngenc.c @@ -158,6 +158,7 @@ gst_mngenc_sinklink (GstPad * pad, const GstCaps * caps) GstMngEnc *mngenc; gdouble fps; GstStructure *structure; + GstPadLinkReturn result; mngenc = GST_MNGENC (gst_pad_get_parent (pad)); @@ -172,7 +173,10 @@ gst_mngenc_sinklink (GstPad * pad, const GstCaps * caps) "width", G_TYPE_INT, mngenc->width, "height", G_TYPE_INT, mngenc->height, NULL); - return gst_pad_try_set_caps (mngenc->srcpad, caps); + result = gst_pad_try_set_caps (mngenc->srcpad, caps); + gst_object_unref (mngenc); + + return result; } static void @@ -202,6 +206,7 @@ gst_mngenc_chain (GstPad * pad, GstData * _data) /* FIXME, do something here */ gst_buffer_unref (buf); + gst_object_unref (mngenc); } diff --git a/ext/libpng/gstpngenc.c b/ext/libpng/gstpngenc.c index 190ffbb3..f52e57b4 100644 --- a/ext/libpng/gstpngenc.c +++ b/ext/libpng/gstpngenc.c @@ -176,6 +176,9 @@ gst_pngenc_setcaps (GstPad * pad, GstCaps * caps) gst_caps_unref (pcaps); gst_object_unref (opeer); } + + gst_object_unref (pngenc); + return ret; } diff --git a/ext/mikmod/gstmikmod.c b/ext/mikmod/gstmikmod.c index db83dc46..4226467f 100644 --- a/ext/mikmod/gstmikmod.c +++ b/ext/mikmod/gstmikmod.c @@ -269,6 +269,7 @@ gst_mikmod_srclink (GstPad * pad, const GstCaps * caps) GstStructure *structure; gint depth; gint channels; + gboolean result; filter = GST_MIKMOD (gst_pad_get_parent (pad)); @@ -280,7 +281,14 @@ gst_mikmod_srclink (GstPad * pad, const GstCaps * caps) filter->stereo = (channels == 2); gst_structure_get_int (structure, "rate", &filter->mixfreq); - return gst_mikmod_setup (filter) ? GST_PAD_LINK_OK : GST_PAD_LINK_REFUSED; + result = gst_mikmod_setup (filter); + gst_object_unref (filter); + + if (result) { + return GST_PAD_LINK_OK; + } else { + return GST_PAD_LINK_REFUSED; + } } static void 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 diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index a17f1066..253b7da7 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -317,8 +317,10 @@ gst_avimux_vidsinkconnect (GstPad * pad, const GstCaps * vscaps) ret &= gst_structure_get_int (structure, "height", &avimux->vids.height); fps = gst_structure_get_value (structure, "framerate"); ret &= (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps)); - if (!ret) + if (!ret) { + gst_object_unref (avimux); return GST_PAD_LINK_REFUSED; + } avimux->vids_hdr.rate = gst_value_get_fraction_numerator (fps); avimux->vids_hdr.scale = gst_value_get_fraction_denominator (fps); @@ -388,6 +390,7 @@ gst_avimux_vidsinkconnect (GstPad * pad, const GstCaps * vscaps) } if (!avimux->vids.compression) { + gst_object_unref (avimux); return GST_PAD_LINK_DELAYED; } } @@ -397,6 +400,9 @@ gst_avimux_vidsinkconnect (GstPad * pad, const GstCaps * vscaps) avimux->avi_hdr.width = avimux->vids.width; avimux->avi_hdr.height = avimux->vids.height; avimux->avi_hdr.us_frame = avimux->vids_hdr.scale; + + gst_object_unref (avimux); + return GST_PAD_LINK_OK; } @@ -463,6 +469,7 @@ gst_avimux_audsinkconnect (GstPad * pad, const GstCaps * vscaps) avimux->auds.size = 16; if (!avimux->auds.format) { + gst_object_unref (avimux); return GST_PAD_LINK_REFUSED; } } @@ -470,6 +477,9 @@ gst_avimux_audsinkconnect (GstPad * pad, const GstCaps * vscaps) avimux->auds_hdr.rate = avimux->auds.blockalign * avimux->auds.rate; avimux->auds_hdr.samplesize = avimux->auds.blockalign; avimux->auds_hdr.scale = 1; + + gst_object_unref (avimux); + return GST_PAD_LINK_OK; } @@ -1089,6 +1099,7 @@ gst_avimux_handle_event (GstPad * pad, GstEvent * event) } gst_event_unref (event); + gst_object_unref (avimux); return TRUE; } diff --git a/gst/debug/negotiation.c b/gst/debug/negotiation.c index 25f30024..da8a3033 100644 --- a/gst/debug/negotiation.c +++ b/gst/debug/negotiation.c @@ -210,6 +210,7 @@ gst_negotiation_getcaps (GstPad * pad) GST_PTR_FORMAT, pad, caps); gst_negotiation_update_caps (negotiation); + gst_object_unref (negotiation); return caps; } @@ -228,6 +229,7 @@ gst_negotiation_pad_link (GstPad * pad, const GstCaps * caps) GST_ERROR ("pad_link called on %" GST_PTR_FORMAT " with caps %" GST_PTR_FORMAT ", returning %d", pad, caps, ret); + gst_object_unref (negotiation); return ret; } @@ -257,6 +259,7 @@ gst_negotiation_chain (GstPad * pad, GstData * _data) GstNegotiation *negotiation = GST_NEGOTIATION (gst_pad_get_parent (pad)); gst_pad_push (negotiation->srcpad, _data); + gst_object_unref (negotiation); } static void diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c index 9401249f..1b8d4482 100644 --- a/gst/flx/gstflxdec.c +++ b/gst/flx/gstflxdec.c @@ -627,7 +627,7 @@ gst_flxdec_chain (GstPad * pad, GstBuffer * buf) } } need_more_data: - + gst_object_unref (flxdec); return res; /* ERRORS */ @@ -635,6 +635,7 @@ wrong_type: { GST_ELEMENT_ERROR (flxdec, STREAM, WRONG_TYPE, (NULL), ("not a flx file (type %x)", flxh->type)); + gst_object_unref (flxdec); return GST_FLOW_ERROR; } } diff --git a/gst/law/mulaw-encode.c b/gst/law/mulaw-encode.c index defb7dde..f9e1eccd 100644 --- a/gst/law/mulaw-encode.c +++ b/gst/law/mulaw-encode.c @@ -126,6 +126,7 @@ mulawenc_setcaps (GstPad * pad, GstCaps * caps) gst_pad_set_caps (otherpad, base_caps); + gst_object_unref (mulawenc); gst_caps_unref (base_caps); return TRUE; diff --git a/gst/median/gstmedian.c b/gst/median/gstmedian.c index 4327c009..3f09f086 100644 --- a/gst/median/gstmedian.c +++ b/gst/median/gstmedian.c @@ -154,6 +154,8 @@ gst_median_link (GstPad * pad, const GstCaps * caps) filter->height = h; } + gst_object_unref (filter); + return ret; } diff --git a/gst/monoscope/gstmonoscope.c b/gst/monoscope/gstmonoscope.c index 4497d9ce..82d3cb7a 100644 --- a/gst/monoscope/gstmonoscope.c +++ b/gst/monoscope/gstmonoscope.c @@ -224,6 +224,8 @@ gst_monoscope_srcconnect (GstPad * pad, const GstCaps * caps) gst_structure_get_int (structure, "height", &monoscope->height); gst_structure_get_double (structure, "framerate", &monoscope->fps); + gst_object_unref (monoscope); + return GST_PAD_LINK_OK; } @@ -250,6 +252,7 @@ gst_monoscope_chain (GstPad * pad, GstData * _data) GST_DEBUG ("timestamp is %" G_GUINT64_FORMAT ": want >= %" G_GUINT64_FORMAT, GST_BUFFER_TIMESTAMP (bufin), monoscope->next_time); gst_buffer_unref (bufin); + gst_object_unref (monoscope); return; } @@ -266,6 +269,7 @@ gst_monoscope_chain (GstPad * pad, GstData * _data) if (!gst_pad_is_negotiated (monoscope->srcpad)) { if (gst_pad_renegotiate (monoscope->srcpad) <= 0) { GST_ELEMENT_ERROR (monoscope, CORE, NEGOTIATION, (NULL), (NULL)); + gst_object_unref (monoscope); return; } } @@ -284,6 +288,7 @@ gst_monoscope_chain (GstPad * pad, GstData * _data) gst_pad_push (monoscope->srcpad, GST_DATA (bufout)); gst_buffer_unref (bufin); + gst_object_unref (monoscope); GST_DEBUG ("Monoscope: exiting chainfunc"); diff --git a/gst/rtp/gstrtpL16pay.c b/gst/rtp/gstrtpL16pay.c index 466e4b0a..f68425c0 100644 --- a/gst/rtp/gstrtpL16pay.c +++ b/gst/rtp/gstrtpL16pay.c @@ -171,13 +171,17 @@ gst_rtpL16pay_sinkconnect (GstPad * pad, const GstCaps * caps) ret = gst_structure_get_int (structure, "rate", &rtpL16enc->frequency); ret &= gst_structure_get_int (structure, "channels", &rtpL16enc->channels); - if (!ret) + if (!ret) { + gst_object_unref (rtpL16enc); return GST_PAD_LINK_REFUSED; + } /* Pre-calculate what we can */ rtpL16enc->time_interval = GST_SECOND / (2 * rtpL16enc->channels * rtpL16enc->frequency); + gst_object_unref (rtpL16enc); + return GST_PAD_LINK_OK; } diff --git a/gst/wavenc/gstwavenc.c b/gst/wavenc/gstwavenc.c index da6b8b7d..f392b6ee 100644 --- a/gst/wavenc/gstwavenc.c +++ b/gst/wavenc/gstwavenc.c @@ -253,9 +253,12 @@ gst_wavenc_sink_setcaps (GstPad * pad, GstCaps * caps) gst_wavenc_setup (wavenc); if (wavenc->setup) { + gst_object_unref (wavenc); return TRUE; } + gst_object_unref (wavenc); + return FALSE; } diff --git a/sys/osxaudio/gstosxaudiosink.c b/sys/osxaudio/gstosxaudiosink.c index 2f4e27bc..433bd4d1 100644 --- a/sys/osxaudio/gstosxaudiosink.c +++ b/sys/osxaudio/gstosxaudiosink.c @@ -168,10 +168,12 @@ gst_osxaudiosink_chain (GstPad * pad, GstData * _data) switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: gst_pad_event_default (pad, event); + gst_object_unref (osxaudiosink); return; case GST_EVENT_DISCONTINUOUS: /* pass-through */ default: + gst_object_unref (osxaudiosink); gst_pad_event_default (pad, event); return; } @@ -189,6 +191,7 @@ gst_osxaudiosink_chain (GstPad * pad, GstData * _data) write_buffer (GST_OSXAUDIOELEMENT (osxaudiosink), data, to_write); } gst_buffer_unref (buf); + gst_object_unref (osxaudiosink); } static GstStateChangeReturn diff --git a/sys/osxaudio/gstosxaudiosrc.c b/sys/osxaudio/gstosxaudiosrc.c index 94877ef5..6d0331ca 100644 --- a/sys/osxaudio/gstosxaudiosrc.c +++ b/sys/osxaudio/gstosxaudiosrc.c @@ -159,11 +159,13 @@ gst_osxaudiosrc_get (GstPad * pad) if (readbytes < 0) { gst_buffer_unref (buf); GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM); + gst_object_unref (src); return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT)); } if (readbytes == 0) { gst_buffer_unref (buf); + gst_object_unref (src); return GST_DATA (gst_event_new (GST_EVENT_INTERRUPT)); } @@ -174,6 +176,8 @@ gst_osxaudiosrc_get (GstPad * pad) GST_DEBUG ("pushed buffer from soundcard of %ld bytes", readbytes); + gst_object_unref (src); + return GST_DATA (buf); } -- cgit