From 9ab6406f23e4374c5d5299537546db833d3bb3b8 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 9 Nov 2011 11:17:15 -0300 Subject: [PATCH] camerabin2: Don't store preview location if preview isn't requested Do not store preview location is post-previews is false, this would mess up preview naming in case application switches between enabling and disabling previews --- gst/camerabin2/gstcamerabin2.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 8ba8a4ecfa..693af1f144 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -377,11 +377,6 @@ gst_camera_bin_start_capture (GstCameraBin2 * camerabin) GST_CAMERA_BIN2_PROCESSING_INC (camerabin); - if (camerabin->post_previews) { - /* Count processing of preview images too */ - GST_CAMERA_BIN2_PROCESSING_INC (camerabin); - } - if (camerabin->location) location = g_strdup_printf (camerabin->location, capture_index); @@ -410,11 +405,17 @@ gst_camera_bin_start_capture (GstCameraBin2 * camerabin) g_slist_append (camerabin->image_location_list, g_strdup (location)); } - /* store the next preview filename */ - g_mutex_lock (camerabin->preview_list_mutex); - camerabin->preview_location_list = - g_slist_append (camerabin->preview_location_list, location); - g_mutex_unlock (camerabin->preview_list_mutex); + if (camerabin->post_previews) { + /* Count processing of preview images too */ + GST_CAMERA_BIN2_PROCESSING_INC (camerabin); + /* store the next preview filename */ + g_mutex_lock (camerabin->preview_list_mutex); + camerabin->preview_location_list = + g_slist_append (camerabin->preview_location_list, location); + g_mutex_unlock (camerabin->preview_list_mutex); + } else { + g_free (location); + } g_signal_emit_by_name (camerabin->src, "start-capture", NULL); if (camerabin->mode == MODE_VIDEO && camerabin->audio_src)