Skip to content
Snippets Groups Projects
Commit 9e81a790 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix version 2 flag clear bug

parent 593c43b0
No related branches found
No related tags found
1 merge request!146Implements #218 red blue swap
Pipeline #15948 passed
This commit is part of merge request !146. Comments created here will be created in the context of that merge request.
......@@ -16,7 +16,7 @@ namespace codecs {
*/
struct Header {
const char magic[4] = {'F','T','L','F'};
uint8_t version = 2;
uint8_t version = 3;
};
/**
......
......@@ -49,6 +49,7 @@ class Reader {
bool has_data_;
int64_t timestart_;
bool playing_;
int version_;
MUTEX mtx_;
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment