Skip to content

Commit

Permalink
Handle start capture errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix committed Feb 22, 2020
1 parent 6e79e0c commit 560d319
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/KinectSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@ KinectSource::~KinectSource() = default;
void KinectSource::OnVisibilityUpdate(bool isVisible)
{
if (isVisible)
m_device.StartCapture(); //< Does nothing if already capturing
{
try
{
m_device.StartCapture(); //< Does nothing if already capturing
}
catch (const std::exception& e)
{
warn("failed to start capture: %s", e.what());
}
}
else if (m_stopOnHide)
{
m_device.StopCapture();
Expand Down

0 comments on commit 560d319

Please sign in to comment.