mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 05:15:01 -06:00
if single-threaded brotli, retain artificial number set in BrotliHandler (0) - always prefer it for .br format, otherwise -mmt1 causes that it'd use brotli-mt and the stream is incompatible; -mmt=n with n >= 2 forces multi-threaded compression/decompression (therefore incompatible with standard brotli)
This commit is contained in:
@@ -100,6 +100,10 @@ STDMETHODIMP CDecoder::SetNumberOfThreads(UInt32 numThreads)
|
||||
const UInt32 kNumThreadsMax = BROTLIMT_THREAD_MAX;
|
||||
if (numThreads < 0) numThreads = 0;
|
||||
if (numThreads > kNumThreadsMax) numThreads = kNumThreadsMax;
|
||||
// if single-threaded, retain artificial number set in BrotliHandler (always prefer .br format):
|
||||
if (_numThreads == 0 && numThreads == 1) {
|
||||
numThreads = 0;
|
||||
}
|
||||
_numThreads = numThreads;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user