+2005-08-26 Jan Schmidt <thaytan@mad.scientist.com>
+
+ * ext/ogg/gstoggdemux.c: (gst_ogg_pad_dispose):
+ * ext/vorbis/vorbisdec.c: (gst_vorbis_dec_class_init),
+ (vorbisdec_finalize), (vorbis_handle_type_packet):
+ Big shout-out to MikeS for fixing this giant memory leak.
+ Huzzah!
+
2005-08-25 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_dispose),
{
GstOggPad *pad = GST_OGG_PAD (object);
+ if (pad->element)
+ gst_element_set_state (pad->element, GST_STATE_NULL);
+
gst_object_replace ((GstObject **) (&pad->elem_pad), NULL);
gst_object_replace ((GstObject **) (&pad->element), NULL);
gst_object_replace ((GstObject **) (&pad->elem_out), NULL);
GST_BOILERPLATE (GstVorbisDec, gst_vorbis_dec, GstElement, GST_TYPE_ELEMENT);
+static void vorbisdec_finalize (GObject * object);
static gboolean vorbis_dec_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn vorbis_dec_chain (GstPad * pad, GstBuffer * buffer);
static GstElementStateReturn vorbis_dec_change_state (GstElement * element);
static void
gst_vorbis_dec_class_init (GstVorbisDecClass * klass)
{
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
+ gobject_class->finalize = vorbisdec_finalize;
+
gstelement_class->change_state = vorbis_dec_change_state;
}
dec->queued = NULL;
}
+static void
+vorbisdec_finalize (GObject * object)
+{
+ /* Release any possibly allocated libvorbis data.
+ * _clear functions can safely be called multiple times
+ */
+ GstVorbisDec *vd = GST_VORBIS_DEC (object);
+
+ vorbis_block_clear (&vd->vb);
+ vorbis_dsp_clear (&vd->vd);
+ vorbis_comment_clear (&vd->vc);
+ vorbis_info_clear (&vd->vi);
+}
+
static gboolean
vorbis_dec_convert (GstPad * pad,
GstFormat src_format, gint64 src_value,
static GstFlowReturn
vorbis_handle_type_packet (GstVorbisDec * vd)
{
+ g_assert (vd->initialized == FALSE);
+
vorbis_synthesis_init (&vd->vd, &vd->vi);
vorbis_block_init (&vd->vd, &vd->vb);
vd->initialized = TRUE;