diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-29 12:02:19 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-29 12:02:19 +0200 |
commit | 0647d963ef5abcbbe4edbc5a80b87bf84470c6b3 (patch) | |
tree | 1f4f470972b77c9817b6a10dd987d7ddbb21ac26 /gst/frei0r | |
parent | 72fca8a828b05b9dbf2b02b7754006755954fc47 (diff) | |
download | gst-plugins-bad-0647d963ef5abcbbe4edbc5a80b87bf84470c6b3.tar.gz gst-plugins-bad-0647d963ef5abcbbe4edbc5a80b87bf84470c6b3.tar.bz2 gst-plugins-bad-0647d963ef5abcbbe4edbc5a80b87bf84470c6b3.zip |
frei0r: Correctly clean up elements to be reusable and not leak memory
Diffstat (limited to 'gst/frei0r')
-rw-r--r-- | gst/frei0r/gstfrei0rfilter.c | 2 | ||||
-rw-r--r-- | gst/frei0r/gstfrei0rmixer.c | 8 | ||||
-rw-r--r-- | gst/frei0r/gstfrei0rsrc.c | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/gst/frei0r/gstfrei0rfilter.c b/gst/frei0r/gstfrei0rfilter.c index 834e1899..eda78adf 100644 --- a/gst/frei0r/gstfrei0rfilter.c +++ b/gst/frei0r/gstfrei0rfilter.c @@ -59,6 +59,8 @@ gst_frei0r_filter_stop (GstBaseTransform * trans) self->f0r_instance = NULL; } + self->width = self->height = 0; + return TRUE; } diff --git a/gst/frei0r/gstfrei0rmixer.c b/gst/frei0r/gstfrei0rmixer.c index 684519df..8f3ee4ba 100644 --- a/gst/frei0r/gstfrei0rmixer.c +++ b/gst/frei0r/gstfrei0rmixer.c @@ -45,8 +45,16 @@ gst_frei0r_mixer_reset (GstFrei0rMixer * self) self->f0r_instance = NULL; } + if (self->property_cache) + gst_frei0r_property_cache_free (klass->properties, self->property_cache, + klass->n_properties); + self->property_cache = NULL; + gst_caps_replace (&self->caps, NULL); gst_event_replace (&self->newseg_event, NULL); + + self->fmt = GST_VIDEO_FORMAT_UNKNOWN; + self->width = self->height = 0; } static void diff --git a/gst/frei0r/gstfrei0rsrc.c b/gst/frei0r/gstfrei0rsrc.c index 8a4a4e2a..2d637f95 100644 --- a/gst/frei0r/gstfrei0rsrc.c +++ b/gst/frei0r/gstfrei0rsrc.c @@ -146,6 +146,11 @@ gst_frei0r_src_stop (GstBaseSrc * basesrc) self->f0r_instance = NULL; } + self->fmt = GST_VIDEO_FORMAT_UNKNOWN; + self->width = self->height = 0; + self->fps_n = self->fps_d = 0; + self->n_frames = 0; + return TRUE; } |