From 8f7201721a823e1daaabbddd20833e5e84baecee Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Mon, 5 Mar 2012 11:41:43 +0100 Subject: Change recording property only on success --- src/uca-camera.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/uca-camera.c') diff --git a/src/uca-camera.c b/src/uca-camera.c index d06a570..f517d87 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -211,9 +211,12 @@ void uca_camera_start_recording(UcaCamera *camera, GError **error) return; } - camera->priv->recording = TRUE; (*klass->start_recording)(camera, error); - g_object_notify_by_pspec(G_OBJECT(camera), camera_properties[PROP_IS_RECORDING]); + + if (error == NULL) { + camera->priv->recording = TRUE; + g_object_notify_by_pspec(G_OBJECT(camera), camera_properties[PROP_IS_RECORDING]); + } } void uca_camera_stop_recording(UcaCamera *camera, GError **error) @@ -231,9 +234,12 @@ void uca_camera_stop_recording(UcaCamera *camera, GError **error) return; } - camera->priv->recording = FALSE; (*klass->stop_recording)(camera, error); - g_object_notify_by_pspec(G_OBJECT(camera), camera_properties[PROP_IS_RECORDING]); + + if (error == NULL) { + camera->priv->recording = FALSE; + g_object_notify_by_pspec(G_OBJECT(camera), camera_properties[PROP_IS_RECORDING]); + } } void uca_camera_set_grab_func(UcaCamera *camera, UcaCameraGrabFunc func) -- cgit v1.2.3