diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/amrwb/gstamrwbparse.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/amrwb/gstamrwbparse.c b/ext/amrwb/gstamrwbparse.c index 2054fc25..f7a7e274 100644 --- a/ext/amrwb/gstamrwbparse.c +++ b/ext/amrwb/gstamrwbparse.c @@ -75,6 +75,8 @@ static gboolean gst_amrwbparse_sink_activate_pull (GstPad * sinkpad, static GstStateChangeReturn gst_amrwbparse_state_change (GstElement * element, GstStateChange transition); +static void gst_amrwbparse_finalize (GObject * object); + #define _do_init(bla) \ GST_DEBUG_CATEGORY_INIT (gst_amrwbparse_debug, "amrwbparse", 0, "AMR-WB audio stream parser"); @@ -102,8 +104,11 @@ gst_amrwbparse_base_init (gpointer klass) static void gst_amrwbparse_class_init (GstAmrwbParseClass * klass) { + GObjectClass *object_class = G_OBJECT_CLASS (klass); GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + object_class->finalize = gst_amrwbparse_finalize; + element_class->change_state = GST_DEBUG_FUNCPTR (gst_amrwbparse_state_change); } @@ -137,6 +142,20 @@ gst_amrwbparse_init (GstAmrwbParse * amrwbparse, GstAmrwbParseClass * klass) amrwbparse->ts = 0; } +static void +gst_amrwbparse_finalize (GObject * object) +{ + GstAmrwbParse *amrwbparse; + + amrwbparse = GST_AMRWBPARSE (object); + + gst_adapter_clear (amrwbparse->adapter); + g_object_unref (amrwbparse->adapter); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + + static const GstQueryType * gst_amrwbparse_querytypes (GstPad * pad) { |