mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 09:14:58 -06:00
Modified lz4 code to create a fix for #73
- by default, 7-Zip ZS creates lz4 streams with skippable frames, cause this makes parallel decompression possible - but: sometimes this feature is not needed or wanted - this patch will skip the writing of the additional frames for lz4, when compressing single threaded (-mmt=1)
This commit is contained in:
@@ -291,11 +291,13 @@ static void *pt_compress(void *arg)
|
||||
}
|
||||
|
||||
/* write skippable frame */
|
||||
MEM_writeLE32((unsigned char *)wl->out.buf + 0,
|
||||
LZ4FMT_MAGIC_SKIPPABLE);
|
||||
MEM_writeLE32((unsigned char *)wl->out.buf + 4, 4);
|
||||
MEM_writeLE32((unsigned char *)wl->out.buf + 8, (U32) result);
|
||||
wl->out.size = result + 12;
|
||||
if (ctx->threads > 1) {
|
||||
MEM_writeLE32((unsigned char *)wl->out.buf + 0,
|
||||
LZ4FMT_MAGIC_SKIPPABLE);
|
||||
MEM_writeLE32((unsigned char *)wl->out.buf + 4, 4);
|
||||
MEM_writeLE32((unsigned char *)wl->out.buf + 8, (U32) result);
|
||||
wl->out.size = result + 12;
|
||||
}
|
||||
|
||||
/* write result */
|
||||
pthread_mutex_lock(&ctx->write_mutex);
|
||||
|
||||
Reference in New Issue
Block a user