mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 20:06:59 -06:00
Fix #130 - incorrect progress number with zstd
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
// (C) 2016 - 2020 Tino Reichardt
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
#if 0
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
@@ -371,7 +369,7 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
#if 0
|
||||
printf("err=%u ", (unsigned)err);
|
||||
printf("srcSize=%u ", (unsigned)srcSize);
|
||||
printf("todo=%u\n", ZSTD_todo);
|
||||
@@ -379,6 +377,8 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
||||
printf("inBuff.pos=%u\n", (unsigned)inBuff.pos);
|
||||
printf("outBuff.size=%u ", (unsigned)outBuff.size);
|
||||
printf("outBuff.pos=%u\n\n", (unsigned)outBuff.pos);
|
||||
printf("_processedIn=%u ", (unsigned)_processedIn);
|
||||
printf("_processedOut=%u\n", (unsigned)_processedOut);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
@@ -386,9 +386,11 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
|
||||
if (outBuff.pos) {
|
||||
RINOK(WriteStream(outStream, _dstBuf, outBuff.pos));
|
||||
_processedOut += outBuff.pos;
|
||||
RINOK(progress->SetRatioInfo(&_processedIn, &_processedOut));
|
||||
}
|
||||
|
||||
if (progress)
|
||||
RINOK(progress->SetRatioInfo(&_processedIn, &_processedOut));
|
||||
|
||||
/* done */
|
||||
if (ZSTD_todo == ZSTD_e_end && err == 0)
|
||||
return S_OK;
|
||||
|
||||
Reference in New Issue
Block a user