Commit d3648ca5 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller
Browse files

gst-libs/gst/tag/gsttagdemux.c: Don't leak caps.

Original commit message from CVS:
* gst-libs/gst/tag/gsttagdemux.c:
Don't leak caps.
parent f277cd88
2007-10-06 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/tag/gsttagdemux.c:
Don't leak caps.
2007-10-06 Tim-Philipp Müller <tim at centricular dot net> 2007-10-06 Tim-Philipp Müller <tim at centricular dot net>
   
* gst-libs/gst/tag/Makefile.am: * gst-libs/gst/tag/Makefile.am:
...@@ -296,6 +296,7 @@ gst_tag_demux_add_srcpad (GstTagDemux * tagdemux, GstCaps * new_caps) ...@@ -296,6 +296,7 @@ gst_tag_demux_add_srcpad (GstTagDemux * tagdemux, GstCaps * new_caps)
!gst_caps_is_equal (new_caps, tagdemux->priv->src_caps)) { !gst_caps_is_equal (new_caps, tagdemux->priv->src_caps)) {
gst_caps_replace (&tagdemux->priv->src_caps, new_caps); gst_caps_replace (&tagdemux->priv->src_caps, new_caps);
if (tagdemux->priv->srcpad != NULL) { if (tagdemux->priv->srcpad != NULL) {
GST_DEBUG_OBJECT (tagdemux, "Changing src pad caps to %" GST_PTR_FORMAT, GST_DEBUG_OBJECT (tagdemux, "Changing src pad caps to %" GST_PTR_FORMAT,
tagdemux->priv->src_caps); tagdemux->priv->src_caps);
...@@ -304,7 +305,6 @@ gst_tag_demux_add_srcpad (GstTagDemux * tagdemux, GstCaps * new_caps) ...@@ -304,7 +305,6 @@ gst_tag_demux_add_srcpad (GstTagDemux * tagdemux, GstCaps * new_caps)
} }
} else { } else {
/* Caps never changed */ /* Caps never changed */
gst_caps_unref (new_caps);
} }
if (tagdemux->priv->srcpad == NULL) { if (tagdemux->priv->srcpad == NULL) {
...@@ -1174,7 +1174,6 @@ gst_tag_demux_sink_activate (GstPad * sinkpad) ...@@ -1174,7 +1174,6 @@ gst_tag_demux_sink_activate (GstPad * sinkpad)
demux->priv->state = GST_TAG_DEMUX_STREAMING; demux->priv->state = GST_TAG_DEMUX_STREAMING;
/* 6 Add the srcpad for output now we know caps. */ /* 6 Add the srcpad for output now we know caps. */
/* add_srcpad takes ownership of the caps */
if (!gst_tag_demux_add_srcpad (demux, caps)) { if (!gst_tag_demux_add_srcpad (demux, caps)) {
GST_DEBUG_OBJECT (demux, "Could not add source pad"); GST_DEBUG_OBJECT (demux, "Could not add source pad");
goto done_activate; goto done_activate;
...@@ -1190,6 +1189,9 @@ gst_tag_demux_sink_activate (GstPad * sinkpad) ...@@ -1190,6 +1189,9 @@ gst_tag_demux_sink_activate (GstPad * sinkpad)
done_activate: done_activate:
if (caps)
gst_caps_unref (caps);
return ret; return ret;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment