stop device correctly

parent f022eeb7
...@@ -286,10 +286,9 @@ int Loop() ...@@ -286,10 +286,9 @@ int Loop()
} }
} }
if (device->is_streaming())
device->stop();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
//std::this_thread::sleep_for(std::chrono::milliseconds(100));
for (int j = 0; j < 4; ++j) for (int j = 0; j < 4; ++j)
{ {
...@@ -297,6 +296,10 @@ int Loop() ...@@ -297,6 +296,10 @@ int Loop()
if (device->is_stream_enabled(s)) device->disable_stream(s); if (device->is_stream_enabled(s)) device->disable_stream(s);
} }
if (device->is_streaming())
device->stop();
looping = false; looping = false;
return 0; return 0;
} }
......
Markdown is supported
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