Stop viewfinder after the pipeline reaches idle state.
authorMohammed Sameer <msameer@foolab.org>
Sat, 8 Dec 2012 22:50:41 +0000 (00:50 +0200)
committerMohammed Sameer <msameer@foolab.org>
Sat, 8 Dec 2012 22:50:41 +0000 (00:50 +0200)
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

lib/qtcamdevice.cpp

index 2eb5d3f..7d5acbf 100644 (file)
@@ -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;