Skip to content

Commit

Permalink
Resync FSEQFile with xLights
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed May 4, 2019
1 parent b7b0757 commit 58b30c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/fseq/FSEQFile.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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<uint32_t, uint64_t>(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)) {
Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/fseq/FSEQFile.h
Expand Up @@ -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;
Expand Down

0 comments on commit 58b30c1

Please sign in to comment.