From 1e9c6d836120fdd929572cd6f3180cc2fbae519d Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Thu, 26 Oct 2023 11:47:10 -0700 Subject: [PATCH] Use ZSTD compression level defaults. #726 --- mz_strm_zstd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mz_strm_zstd.c b/mz_strm_zstd.c index c714b369..5d49bbe7 100644 --- a/mz_strm_zstd.c +++ b/mz_strm_zstd.c @@ -50,7 +50,7 @@ typedef struct mz_stream_zstd_s { int64_t max_total_in; int64_t max_total_out; int8_t initialized; - uint32_t preset; + int32_t preset; } mz_stream_zstd; /***************************************************************************/ @@ -313,7 +313,7 @@ int32_t mz_stream_zstd_set_prop_int64(void *stream, int32_t prop, int64_t value) switch (prop) { case MZ_STREAM_PROP_COMPRESS_LEVEL: if (value < 0) - zstd->preset = 0; // Use zstd default. + zstd->preset = ZSTD_CLEVEL_DEFAULT; else zstd->preset = (int16_t)value; return MZ_OK; @@ -329,6 +329,7 @@ void *mz_stream_zstd_create(void) { if (zstd) { zstd->stream.vtbl = &mz_stream_zstd_vtbl; zstd->max_total_out = -1; + zstd->preset = ZSTD_CLEVEL_DEFAULT; } return zstd; }