From 79bb475abe5f4cee11e5214c9d83df9d049d2792 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Fri, 11 Mar 2011 10:32:35 -0300 Subject: camerabin2: Some memleak fixes --- gst/camerabin2/gstcamerabin2.c | 4 +++- gst/camerabin2/gstwrappercamerabinsrc.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'gst') diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 8c2bb20c8..8b93ad8cb 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -308,6 +308,8 @@ gst_camera_bin_dispose (GObject * object) gst_object_unref (camerabin->audio_queue); if (camerabin->audio_convert) gst_object_unref (camerabin->audio_convert); + if (camerabin->audio_volume) + gst_object_unref (camerabin->audio_volume); if (camerabin->viewfinderbin) gst_object_unref (camerabin->viewfinderbin); @@ -1033,7 +1035,7 @@ gst_camera_bin_change_state (GstElement * element, GstStateChange trans) case GST_STATE_CHANGE_PAUSED_TO_READY: if (GST_STATE (camera->videosink) >= GST_STATE_PAUSED) gst_element_set_state (camera->videosink, GST_STATE_READY); - if (camera->audio_src) + if (camera->audio_src && GST_STATE (camera->audio_src) >= GST_STATE_READY) gst_element_set_state (camera->audio_src, GST_STATE_READY); gst_tag_setter_reset_tags (GST_TAG_SETTER (camera)); diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 057063f43..e26bd5a17 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -58,6 +58,7 @@ gst_wrapper_camera_bin_src_dispose (GObject * object) gst_object_unref (self->app_vid_src); self->app_vid_src = NULL; } + gst_caps_replace (&self->image_capture_caps, NULL); G_OBJECT_CLASS (parent_class)->dispose (object); } -- cgit v1.2.3