diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2017-08-29 22:49:43 +0300 |
---|---|---|
committer | Kornel <kornel@geekhood.net> | 2017-08-29 22:49:43 +0300 |
commit | b5dc853b2496447f0a54b3b25cb2659b575c56ef (patch) | |
tree | 82b48a2ca0f97915b2aeeb7ae9456711f13cd49a /CPP/7zip/Archive/7z/7zEncode.cpp | |
parent | 2efa10565ac395d2ce9a679ead46e70fb2f963eb (diff) |
17.0117.01
Diffstat (limited to 'CPP/7zip/Archive/7z/7zEncode.cpp')
-rw-r--r-- | CPP/7zip/Archive/7z/7zEncode.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CPP/7zip/Archive/7z/7zEncode.cpp b/CPP/7zip/Archive/7z/7zEncode.cpp index b206faa5..8700d721 100644 --- a/CPP/7zip/Archive/7z/7zEncode.cpp +++ b/CPP/7zip/Archive/7z/7zEncode.cpp @@ -370,6 +370,17 @@ HRESULT CEncoder::Encode( resetInitVector->ResetInitVector(); } + { + CMyComPtr<ICompressSetCoderPropertiesOpt> optProps; + coder->QueryInterface(IID_ICompressSetCoderPropertiesOpt, (void **)&optProps); + if (optProps) + { + PROPID propID = NCoderPropID::kExpectedDataSize; + NWindows::NCOM::CPropVariant prop = (UInt64)unpackSize; + RINOK(optProps->SetCoderPropertiesOpt(&propID, &prop, 1)); + } + } + CMyComPtr<ICompressWriteCoderProperties> writeCoderProperties; coder->QueryInterface(IID_ICompressWriteCoderProperties, (void **)&writeCoderProperties); @@ -380,7 +391,7 @@ HRESULT CEncoder::Encode( CDynBufSeqOutStream *outStreamSpec = new CDynBufSeqOutStream; CMyComPtr<ISequentialOutStream> dynOutStream(outStreamSpec); outStreamSpec->Init(); - writeCoderProperties->WriteCoderProperties(dynOutStream); + RINOK(writeCoderProperties->WriteCoderProperties(dynOutStream)); outStreamSpec->CopyToBuffer(props); } else |