From 9d47e55e2c9cfe03634bb1ae71cd9abb8ff80c4e Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Fri, 8 Aug 2014 12:29:52 +0200 Subject: [PATCH] rtpmux: Unref pad template caps after usage Fixes https://bugzilla.gnome.org/show_bug.cgi?id=734473 --- gst/rtpmanager/gstrtpmux.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gst/rtpmanager/gstrtpmux.c b/gst/rtpmanager/gstrtpmux.c index 4cd06ab..2df52b3 100644 --- a/gst/rtpmanager/gstrtpmux.c +++ b/gst/rtpmanager/gstrtpmux.c @@ -632,21 +632,24 @@ gst_rtp_mux_getcaps (GstPad * pad, GstRTPMux * mux, GstCaps * filter) GstIteratorResult res; GstCaps *peercaps; GstCaps *othercaps; + GstCaps *tcaps; peercaps = gst_pad_peer_query_caps (mux->srcpad, filter); if (peercaps) { - othercaps = gst_caps_intersect_full (peercaps, - gst_pad_get_pad_template_caps (pad), GST_CAPS_INTERSECT_FIRST); + tcaps = gst_pad_get_pad_template_caps (pad); + othercaps = gst_caps_intersect_full (peercaps, tcaps, + GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); } else { + tcaps = gst_pad_get_pad_template_caps (mux->srcpad); if (filter) - othercaps = gst_caps_intersect_full (filter, - gst_pad_get_pad_template_caps (mux->srcpad), + othercaps = gst_caps_intersect_full (filter, tcaps, GST_CAPS_INTERSECT_FIRST); else - othercaps = gst_caps_copy (gst_pad_get_pad_template_caps (mux->srcpad)); + othercaps = gst_caps_copy (tcaps); } + gst_caps_unref (tcaps); clear_caps (othercaps, FALSE); -- 2.7.4