From 6411fade3ce7ae5521f8c6e8f84fa836f134b811 Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 7 Sep 2023 20:27:38 +0200 Subject: [PATCH] translate threads to decoder (previously ignored): important for -mmt>=2 to use brotli-mt (the streams are incompatible) --- CPP/7zip/Archive/BrotliHandler.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CPP/7zip/Archive/BrotliHandler.cpp b/CPP/7zip/Archive/BrotliHandler.cpp index 734ac5e8..f513c8cf 100644 --- a/CPP/7zip/Archive/BrotliHandler.cpp +++ b/CPP/7zip/Archive/BrotliHandler.cpp @@ -173,6 +173,9 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems, NCompress::NBROTLI::CDecoder *decoderSpec = new NCompress::NBROTLI::CDecoder; decoderSpec->SetNumberOfThreads(0); /* .br - single threaded processing (without header/mt-frames) */ + if (_props._numThreads_WasForced) { + decoderSpec->SetNumberOfThreads(_props._numThreads); // translate to decoder (important for -mmt>=2 to use brotli-mt) + } CMyComPtr decoder = decoderSpec; decoderSpec->SetInStream(_seqStream);