Commit 9df79ec2 authored by Alejandro Homs Puron's avatar Alejandro Homs Puron
Browse files

Restore Interface status to Ready if Camera::prepareAcq fails

parent 67e4e9d9
...@@ -110,12 +110,18 @@ void Interface::prepareAcq() ...@@ -110,12 +110,18 @@ void Interface::prepareAcq()
m_stream->release_all_msgs(); m_stream->release_all_msgs();
m_stream->resetStatistics(); m_stream->resetStatistics();
m_cam.prepareAcq(); try {
int serie_id; m_cam.getSerieId(serie_id); m_cam.prepareAcq();
m_saving->setSerieId(serie_id); int serie_id; m_cam.getSerieId(serie_id);
if (!use_filewriter) { m_saving->setSerieId(serie_id);
double stream_armed_timeout = 5.0; if (!use_filewriter) {
m_stream->waitArmed(stream_armed_timeout); double stream_armed_timeout = 5.0;
m_stream->waitArmed(stream_armed_timeout);
}
} catch (...) {
m_saving->stop();
m_stream->stop();
throw;
} }
} }
......
...@@ -255,8 +255,12 @@ void Stream::stop() ...@@ -255,8 +255,12 @@ void Stream::stop()
{ {
DEB_MEMBER_FUNCT(); DEB_MEMBER_FUNCT();
AutoMutex aLock(m_cond.mutex()); AutoMutex aLock(m_cond.mutex());
if (!_isRunning()) bool connected = (m_state == Connected);
if (!_isRunning() || connected) {
if (connected)
_abort();
return; return;
}
DEB_TRACE() << "Stopped"; DEB_TRACE() << "Stopped";
m_state = Stopped; m_state = Stopped;
_send_synchro(); _send_synchro();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment