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