Skip to content

Commit

Permalink
fix type mismatches
Browse files Browse the repository at this point in the history
  • Loading branch information
nicegamer7 committed Aug 4, 2024
1 parent e41d63c commit 89fadd5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/gphoto2_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,12 @@ namespace ols {
}

if (delay_enabled) {
auto time_elapsed = std::chrono::steady_clock::now() - time_before_downloading_files;
auto time_remaining = capture_delay_ - std::chrono::duration_cast<std::chrono::seconds>(time_elapsed).count();
while (time_remaining > 0) {
auto time_to_sleep = std::min(time_remaining, 0.5);
std::this_thread::sleep_for(std::chrono::seconds(time_to_sleep));
std::chrono::duration time_elapsed = std::chrono::steady_clock::now() - time_before_downloading_files;
std::chrono::duration time_remaining = std::chrono::seconds(capture_delay_) - time_elapsed;
std::chrono::duration half_second = std::chrono::milliseconds(500);
while (time_remaining.count() > 0) {
std::chrono::duration time_to_sleep = time_remaining < half_second ? time_remaining : half_second;
std::this_thread::sleep_for(time_to_sleep);
if (stop_) {
return;
}
Expand Down

0 comments on commit 89fadd5

Please sign in to comment.