From 58b30c1418f64a10f08e761a962121f9d1555f91 Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Sat, 4 May 2019 14:37:12 -0400 Subject: [PATCH] Resync FSEQFile with xLights --- src/fseq/FSEQFile.cpp | 10 ++++++---- src/fseq/FSEQFile.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/fseq/FSEQFile.cpp b/src/fseq/FSEQFile.cpp index 1bd97bab0..06b5c3775 100644 --- a/src/fseq/FSEQFile.cpp +++ b/src/fseq/FSEQFile.cpp @@ -50,7 +50,6 @@ int gettimeofday(struct timeval * tp, struct timezone * tzp) #define PLATFORM_UNKNOWN #endif - #if defined(PLATFORM_PI) || defined(PLATFORM_BBB) || defined(PLATFORM_ODROID) || defined(PLATFORM_ORANGEPI) || defined(PLATFORM_UNKNOWN) //for FPP, use FPP logging #include "log.h" @@ -924,8 +923,8 @@ class V2ZSTDCompressionHandler : public V2CompressedHandler { uint64_t offset = tell(); LogDebug(VB_SEQUENCE, " Preparing to create a compressed block of data starting at frame %d, offset %" PRIu64 ".\n", frame, offset); m_file->m_frameOffsets.push_back(std::pair(frame, offset)); - int clevel = m_file->m_compressionLevel == -1 ? 10 : m_file->m_compressionLevel; - if (clevel < 0 || clevel > 25) { + int clevel = m_file->m_compressionLevel == -99 ? 10 : m_file->m_compressionLevel; + if (clevel < -25 || clevel > 25) { clevel = 10; } if (frame == 0 && (ZSTD_versionNumber() > 10305)) { @@ -936,6 +935,9 @@ class V2ZSTDCompressionHandler : public V2CompressedHandler { // be as fast as possible clevel = -10; } + if (ZSTD_versionNumber() <= 10305 && clevel < 0) { + clevel = 0; + } ZSTD_initCStream(m_cctx, clevel); } @@ -1098,7 +1100,7 @@ class V2ZLIBCompressionHandler : public V2CompressedHandler { memset(m_stream, 0, sizeof(z_stream)); } if (m_curFrameInBlock == 0) { - int clevel = m_file->m_compressionLevel == -1 ? 3 : m_file->m_compressionLevel; + int clevel = m_file->m_compressionLevel == -99 ? 3 : m_file->m_compressionLevel; if (clevel < 0 || clevel > 9) { clevel = 3; } diff --git a/src/fseq/FSEQFile.h b/src/fseq/FSEQFile.h index f645c2a61..24a2fbae7 100644 --- a/src/fseq/FSEQFile.h +++ b/src/fseq/FSEQFile.h @@ -52,7 +52,7 @@ class FSEQFile { static FSEQFile* createFSEQFile(const std::string &fn, int version, CompressionType ct = CompressionType::zstd, - int level = 10); + int level = -99); //utility methods static std::string getMediaFilename(const std::string &fn); std::string getMediaFilename() const;