summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.com>2011-11-09 11:17:15 -0300
committerThiago Santos <thiago.sousa.santos@collabora.com>2011-11-09 12:30:33 -0300
commit9ab6406f23e4374c5d5299537546db833d3bb3b8 (patch)
tree7ef2a8ee0e63687f3a25bd5791c5dab7c75bd2a9
parent5ca3c9477e766ffa1e13be924432cc783da2ba4d (diff)
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
-rw-r--r--gst/camerabin2/gstcamerabin2.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index 8ba8a4ecf..693af1f14 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)