diff --git a/components/codecs/include/ftl/codecs/packet.hpp b/components/codecs/include/ftl/codecs/packet.hpp index 89df44f9e0128cea76b15adf331796644cb91c6b..f2fa53c8fa860527f1939b61c4962b306da89043 100644 --- a/components/codecs/include/ftl/codecs/packet.hpp +++ b/components/codecs/include/ftl/codecs/packet.hpp @@ -16,7 +16,7 @@ namespace codecs { */ struct Header { const char magic[4] = {'F','T','L','F'}; - uint8_t version = 2; + uint8_t version = 3; }; /** diff --git a/components/codecs/include/ftl/codecs/reader.hpp b/components/codecs/include/ftl/codecs/reader.hpp index cdc50cad30bc07fcc7793b24fb4daf1b308b03a8..69e19f0a5eac16fdb52c4b823f042e38fb71e0e7 100644 --- a/components/codecs/include/ftl/codecs/reader.hpp +++ b/components/codecs/include/ftl/codecs/reader.hpp @@ -49,6 +49,7 @@ class Reader { bool has_data_; int64_t timestart_; bool playing_; + int version_; MUTEX mtx_; diff --git a/components/codecs/src/reader.cpp b/components/codecs/src/reader.cpp index 53225519a572858a8ceb96e42e9b58ee0c839d43..3727bdd3882d4930c8f8c59e7f67035b818334c4 100644 --- a/components/codecs/src/reader.cpp +++ b/components/codecs/src/reader.cpp @@ -27,6 +27,8 @@ bool Reader::begin() { (*stream_).read((char*)&ih, sizeof(ih)); } + version_ = h.version; + // Capture current time to adjust timestamps timestart_ = (ftl::timer::get_time() / ftl::timer::getInterval()) * ftl::timer::getInterval(); playing_ = true; @@ -86,6 +88,11 @@ bool Reader::read(int64_t ts, const std::function<void(const ftl::codecs::Stream // Adjust timestamp get<0>(data).timestamp += timestart_; + // Fix to clear flags for version 2. + if (version_ == 2) { + get<1>(data).flags = 0; + } + // TODO: Need to read ahead a few frames because there may be a // smaller timestamp after this one... requires a buffer. Ideally this // should be resolved during the write process.