summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-04-10 17:22:04 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-04-10 17:22:04 +0200
commita38bf7788d0650868302a73d1809d590d13a44be (patch)
treecaf5ac25f642c9774d4a222c06ff0b087a4f2c62 /ext
parent361d9d6f3053c1f841c9a3f84c0ebfb07fef5abb (diff)
downloadgstreamer-plugins-bad-a38bf7788d0650868302a73d1809d590d13a44be.tar.gz
mplex: avoid leaking pad template caps and superfluous copy
Diffstat (limited to 'ext')
-rw-r--r--ext/mplex/gstmplex.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/mplex/gstmplex.cc b/ext/mplex/gstmplex.cc
index a08d68360..d548f7832 100644
--- a/ext/mplex/gstmplex.cc
+++ b/ext/mplex/gstmplex.cc
@@ -276,7 +276,7 @@ gst_mplex_setcaps (GstPad * pad, GstCaps * caps)
JobStream *jobstream;
GstMplexIBitStream *inputstream;
GstMplexPad *mpad;
- GstCaps *othercaps;
+ GstCaps *othercaps, *templ;
gboolean ret = TRUE;
mplex = GST_MPLEX (GST_PAD_PARENT (pad));
@@ -286,14 +286,16 @@ gst_mplex_setcaps (GstPad * pad, GstCaps * caps)
goto refuse_renegotiation;
/* since muxer does not really check much ... */
- othercaps = gst_caps_intersect (caps, gst_pad_get_pad_template_caps (pad));
+ templ = gst_pad_get_pad_template_caps (pad);
+ othercaps = gst_caps_intersect (caps, templ);
+ gst_caps_unref (templ);
if (othercaps)
gst_caps_unref (othercaps);
else
goto refuse_caps;
/* set the fixed template caps on the srcpad, should accept without objection */
- othercaps = gst_caps_copy (gst_pad_get_pad_template_caps (mplex->srcpad));
+ othercaps = gst_pad_get_pad_template_caps (mplex->srcpad);
ret = gst_pad_set_caps (mplex->srcpad, othercaps);
gst_caps_unref (othercaps);
if (!ret)