Merge pull request #301 from azsde/retry-upon-camera-unavailable

[BUGFIX #299] Do not exit thread upon EAGAIN error when fetching frames
pull/302/head
Michel Promonet 1 year ago committed by GitHub
commit 59a242eda4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -108,8 +108,15 @@ void* V4L2DeviceSource::thread()
LOG(DEBUG) << "waitingFrame\tdelay:" << (1000-(tv.tv_usec/1000)) << "ms";
if (this->getNextFrame() <= 0)
{
LOG(ERROR) << "error:" << strerror(errno);
stop=1;
if (errno == EAGAIN)
{
LOG(NOTICE) << "Retrying getNextFrame";
}
else
{
LOG(ERROR) << "error:" << strerror(errno);
stop=1;
}
}
}
}

Loading…
Cancel
Save