X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fextract.c;fp=src%2Fextract.c;h=6b35a90367d0b106a9a0152804481c47c27c24e1;hp=b200e18cae7496df4f88e365085d3abf918c0341;hb=9bd0659477b3a1ebad90b46106f743d72689bbd3;hpb=d5a64bb4299105c93b4e9a95e97b579c6f9254af diff --git a/src/extract.c b/src/extract.c index b200e18c..6b35a903 100644 --- a/src/extract.c +++ b/src/extract.c @@ -341,30 +341,9 @@ extract_chunk_wrapper(const void *chunk, size_t size, void *_ctx) if (ret) return ret; - if (progress->extract.completed_bytes >= - progress->extract.total_bytes) - { - ctx->next_progress = UINT64_MAX; - } else { - /* Send new message as soon as another 1/128 of the - * total has been extracted. (Arbitrary number.) */ - ctx->next_progress = - progress->extract.completed_bytes + - progress->extract.total_bytes / 128; - - /* ... Unless that would be more than 5000000 bytes, in - * which case send the next after the next 5000000 - * bytes. (Another arbitrary number.) */ - if (progress->extract.completed_bytes + 5000000 < - ctx->next_progress) - ctx->next_progress = - progress->extract.completed_bytes + 5000000; - - /* ... But always send a message as soon as we're - * completely done. */ - if (progress->extract.total_bytes < ctx->next_progress) - ctx->next_progress = progress->extract.total_bytes; - } + set_next_progress(progress->extract.completed_bytes, + progress->extract.total_bytes, + &ctx->next_progress); } if (unlikely(filedes_valid(&ctx->tmpfile_fd))) {