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()
m_stream->release_all_msgs();
m_stream->resetStatistics();
m_cam.prepareAcq();
int serie_id; m_cam.getSerieId(serie_id);
m_saving->setSerieId(serie_id);
if (!use_filewriter) {
double stream_armed_timeout = 5.0;
m_stream->waitArmed(stream_armed_timeout);
try {
m_cam.prepareAcq();
int serie_id; m_cam.getSerieId(serie_id);
m_saving->setSerieId(serie_id);
if (!use_filewriter) {
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()
{
DEB_MEMBER_FUNCT();
AutoMutex aLock(m_cond.mutex());
if (!_isRunning())
bool connected = (m_state == Connected);
if (!_isRunning() || connected) {
if (connected)
_abort();
return;
}
DEB_TRACE() << "Stopped";
m_state = Stopped;
_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