From a884f2994869a266454e3a1068c8addfccd185da Mon Sep 17 00:00:00 2001 From: sebres Date: Thu, 31 Aug 2023 21:18:25 +0200 Subject: [PATCH] fixes `-mmt=` option for many handlers (previously ignored by handlers used SetCoderProperties to set number of threads) --- CPP/7zip/Archive/Common/HandlerOut.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CPP/7zip/Archive/Common/HandlerOut.cpp b/CPP/7zip/Archive/Common/HandlerOut.cpp index 1b9a93eb..aa43f0b0 100644 --- a/CPP/7zip/Archive/Common/HandlerOut.cpp +++ b/CPP/7zip/Archive/Common/HandlerOut.cpp @@ -203,8 +203,9 @@ HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIAN { HRESULT hres; - if (SetCommonProperty(name, value, hres)) - return hres; + SetCommonProperty(name, value, hres); + /* don't return here, since many handlers set common properties (e. g. kNumThreads) + with SetCoderProperties, so add it also as prop by its ID from name below */ } UInt32 number; @@ -258,11 +259,9 @@ HRESULT CSingleMethodProps::SetProperty(const wchar_t *name2, const PROPVARIANT } { HRESULT hres; - if (SetCommonProperty(name, value, hres)) - { - // processed = true; - return S_OK; - } + SetCommonProperty(name, value, hres); + /* don't return here, since many handlers set common properties (e. g. kNumThreads) + with SetCoderProperties, so add it also as prop by its ID from name below */ } RINOK(ParseMethodFromPROPVARIANT(name, value)); return S_OK;