Fix update_progress for files >4GiB

This commit is contained in:
Marcus Holland-Moritz 2023-08-20 09:57:03 +02:00
parent af8aafc30f
commit 323ece6589

View File

@ -1075,12 +1075,13 @@ void segmenter_<LoggerPolicy, SegmentingPolicy>::segment_and_add_data(
// TODO: how can we reasonably update the top progress bar with // TODO: how can we reasonably update the top progress bar with
// multiple concurrent segmenters? // multiple concurrent segmenters?
auto update_progress = [this, last_offset = 0](size_t offset) mutable { auto update_progress =
auto bytes = frames_to_bytes(offset - last_offset); [this, last_offset = static_cast<size_t>(0)](size_t offset) mutable {
prog_.total_bytes_read += bytes; auto bytes = frames_to_bytes(offset - last_offset);
pctx_->bytes_processed += bytes; prog_.total_bytes_read += bytes;
last_offset = offset; pctx_->bytes_processed += bytes;
}; last_offset = offset;
};
while (offset_in_frames < size_in_frames) { while (offset_in_frames < size_in_frames) {
++stats_.bloom_lookups; ++stats_.bloom_lookups;