Skip to content

Commit 59a242e

Browse files
authored
Merge pull request #301 from azsde/retry-upon-camera-unavailable
[BUGFIX #299] Do not exit thread upon EAGAIN error when fetching frames
2 parents 9029be3 + cb9a64b commit 59a242e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/V4L2DeviceSource.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,15 @@ void* V4L2DeviceSource::thread()
108108
LOG(DEBUG) << "waitingFrame\tdelay:" << (1000-(tv.tv_usec/1000)) << "ms";
109109
if (this->getNextFrame() <= 0)
110110
{
111-
LOG(ERROR) << "error:" << strerror(errno);
112-
stop=1;
111+
if (errno == EAGAIN)
112+
{
113+
LOG(NOTICE) << "Retrying getNextFrame";
114+
}
115+
else
116+
{
117+
LOG(ERROR) << "error:" << strerror(errno);
118+
stop=1;
119+
}
113120
}
114121
}
115122
}

0 commit comments

Comments
 (0)