Fix hang on stream termination if no frames can be captured (#709)

This commit is contained in:
Cameron Gutman
2023-01-05 10:21:38 -06:00
committed by GitHub
parent f1c225fccc
commit 00aa23b342
9 changed files with 39 additions and 30 deletions

View File

@@ -181,10 +181,11 @@ capture_e display_ram_t::capture(snapshot_cb_t &&snapshot_cb, std::shared_ptr<::
case platf::capture_e::error:
return status;
case platf::capture_e::timeout:
img = snapshot_cb(img, false);
std::this_thread::sleep_for(1ms);
continue;
break;
case platf::capture_e::ok:
img = snapshot_cb(img);
img = snapshot_cb(img, true);
break;
default:
BOOST_LOG(error) << "Unrecognized capture status ["sv << (int)status << ']';