Skip to content

Commit

Permalink
Merge pull request #329 from knorth55/fix-272
Browse files Browse the repository at this point in the history
fix calculation of time shift
  • Loading branch information
knorth55 authored Apr 10, 2024
2 parents ef97b79 + f985237 commit 1ce9e6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ time_t util::get_epoch_time_shift_us()
epoch_time.tv_sec * 1000 + static_cast<int64_t>(
std::round(epoch_time.tv_usec / 1000.0));

return static_cast<time_t>((epoch_ms - uptime_ms) / 1000);
return static_cast<time_t>((epoch_ms - uptime_ms) * 1000);
}

timespec util::calc_img_timestamp(const timeval & buffer_time, const time_t & epoch_time_shift_us)
Expand Down Expand Up @@ -60,4 +60,4 @@ unsigned char util::CLIPVALUE(const int & val)
unsigned char clipped_val = val < 0 ? 0 : static_cast<unsigned char>(val);
return val > 255 ? 255 : clipped_val;
}
}
}

0 comments on commit 1ce9e6c

Please sign in to comment.