Fix zstd decompression

- todo: make zstd ldm compression optional
This commit is contained in:
Tino Reichardt
2018-11-03 10:03:54 +01:00
parent 36a17a5184
commit 1a09f6fc0d
2 changed files with 6 additions and 6 deletions

View File

@@ -104,15 +104,19 @@ STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream,
if (!_dstBuf)
return E_OUTOFMEMORY;
/* setup level */
err = ZSTD_CCtx_setParameter(_ctx, ZSTD_p_compressionLevel, _props._level);
if (ZSTD_isError(err)) return E_FAIL;
/* setup thread count */
err = ZSTD_CCtx_setParameter(_ctx, ZSTD_p_nbWorkers, _numThreads);
if (ZSTD_isError(err)) return E_FAIL;
/* set the content size flag */
err = ZSTD_CCtx_setParameter(_ctx, ZSTD_p_contentSizeFlag, 1);
if (ZSTD_isError(err)) return E_FAIL;
/* todo: make this optional */
err = ZSTD_CCtx_setParameter(_ctx, ZSTD_p_enableLongDistanceMatching, 1);
if (ZSTD_isError(err)) return E_FAIL;
}