From: Mohammed Sameer Date: Sat, 8 Dec 2012 22:50:41 +0000 (+0200) Subject: Stop viewfinder after the pipeline reaches idle state. X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=e294eccc8b297ea851c0654d933a0d61e93e0b4e;p=harmattan%2Fcameraplus Stop viewfinder after the pipeline reaches idle state. It might be that a frame arrives after we stop the viewfinder but before we stop the pipeline. That frame will reinitialize the viewfinder again --- diff --git a/lib/qtcamdevice.cpp b/lib/qtcamdevice.cpp index 2eb5d3f..7d5acbf 100644 --- a/lib/qtcamdevice.cpp +++ b/lib/qtcamdevice.cpp @@ -217,8 +217,6 @@ bool QtCamDevice::stop(bool force) { } } - d_ptr->viewfinder->stop(); - d_ptr->stopping = true; // First we go to ready: @@ -231,6 +229,8 @@ bool QtCamDevice::stop(bool force) { // Now to NULL gst_element_set_state(d_ptr->cameraBin, GST_STATE_NULL); + d_ptr->viewfinder->stop(); + d_ptr->stopping = false; return true;