mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
mplex: avoid leaking pad template caps and superfluous copy
This commit is contained in:
parent
361d9d6f30
commit
a38bf7788d
1 changed files with 5 additions and 3 deletions
|
@ -276,7 +276,7 @@ gst_mplex_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
JobStream *jobstream;
|
JobStream *jobstream;
|
||||||
GstMplexIBitStream *inputstream;
|
GstMplexIBitStream *inputstream;
|
||||||
GstMplexPad *mpad;
|
GstMplexPad *mpad;
|
||||||
GstCaps *othercaps;
|
GstCaps *othercaps, *templ;
|
||||||
gboolean ret = TRUE;
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
mplex = GST_MPLEX (GST_PAD_PARENT (pad));
|
mplex = GST_MPLEX (GST_PAD_PARENT (pad));
|
||||||
|
@ -286,14 +286,16 @@ gst_mplex_setcaps (GstPad * pad, GstCaps * caps)
|
||||||
goto refuse_renegotiation;
|
goto refuse_renegotiation;
|
||||||
|
|
||||||
/* since muxer does not really check much ... */
|
/* 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)
|
if (othercaps)
|
||||||
gst_caps_unref (othercaps);
|
gst_caps_unref (othercaps);
|
||||||
else
|
else
|
||||||
goto refuse_caps;
|
goto refuse_caps;
|
||||||
|
|
||||||
/* set the fixed template caps on the srcpad, should accept without objection */
|
/* 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);
|
ret = gst_pad_set_caps (mplex->srcpad, othercaps);
|
||||||
gst_caps_unref (othercaps);
|
gst_caps_unref (othercaps);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
|
Loading…
Reference in a new issue