From d4a2a466062bb3a1f07c68c076c6661878b633b3 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 13 Oct 2011 09:34:04 +0200 Subject: [PATCH] rtpssrcdemux: Fix wrong usage of gst_iterator_filter It takes a GValue* as the user_data. And don't forget to unref the demuxer before returning. --- gst/rtpmanager/gstrtpssrcdemux.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gst/rtpmanager/gstrtpssrcdemux.c b/gst/rtpmanager/gstrtpssrcdemux.c index 13573c8..e298299 100644 --- a/gst/rtpmanager/gstrtpssrcdemux.c +++ b/gst/rtpmanager/gstrtpssrcdemux.c @@ -734,23 +734,28 @@ gst_rtp_ssrc_demux_iterate_internal_links_sink (GstPad * pad) { GstRtpSsrcDemux *demux; GstIterator *it = NULL; - const gchar *prefix = NULL; + GValue gval = { 0, }; demux = GST_RTP_SSRC_DEMUX (gst_pad_get_parent (pad)); if (!demux) return NULL; + g_value_init (&gval, G_TYPE_STRING); if (pad == demux->rtp_sink) - prefix = "src_"; + g_value_set_static_string (&gval, "src_"); else if (pad == demux->rtcp_sink) - prefix = "rtcp_src_"; + g_value_set_static_string (&gval, "rtcp_src_"); else g_assert_not_reached (); it = gst_element_iterate_src_pads (GST_ELEMENT (demux)); - return gst_iterator_filter (it, src_pad_compare_func, (gpointer) prefix); + it = gst_iterator_filter (it, src_pad_compare_func, &gval); + + gst_object_unref (demux); + + return it; } -- 2.7.4