gst-plugins-bad: modplug: fix caps leak

Vincent Penquerc'h vincent at kemper.freedesktop.org
Tue Jan 10 09:28:29 PST 2012


Module: gst-plugins-bad
Branch: master
Commit: 57ec7354eef8270ce2ca22221d19f3b121253c07
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=57ec7354eef8270ce2ca22221d19f3b121253c07

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Tue Jan 10 17:27:54 2012 +0000

modplug: fix caps leak

---

 ext/modplug/gstmodplug.cc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ext/modplug/gstmodplug.cc b/ext/modplug/gstmodplug.cc
index 09dc510..09836a9 100644
--- a/ext/modplug/gstmodplug.cc
+++ b/ext/modplug/gstmodplug.cc
@@ -490,7 +490,6 @@ gst_modplug_load_song (GstModPlug * modplug)
         gst_caps_copy_nth (gst_pad_get_pad_template_caps (modplug->srcpad), 0);
   }
   gst_pad_fixate_caps (modplug->srcpad, newcaps);
-  gst_pad_set_caps (modplug->srcpad, newcaps);
 
   /* set up modplug to output the negotiated format */
   structure = gst_caps_get_structure (newcaps, 0);
@@ -498,6 +497,9 @@ gst_modplug_load_song (GstModPlug * modplug)
   gst_structure_get_int (structure, "channels", &modplug->channel);
   gst_structure_get_int (structure, "rate", &modplug->frequency);
 
+  gst_pad_set_caps (modplug->srcpad, newcaps);
+  gst_caps_unref (newcaps);
+
   modplug->read_samples = 1152;
   modplug->read_bytes =
       modplug->read_samples * modplug->channel * modplug->bits / 8;



More information about the gstreamer-commits mailing list