diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-06-11 17:07:04 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-06-11 17:07:04 +0200 |
commit | 4205ff220c5f7dc71fedb93bce38bddc18aa5b5c (patch) | |
tree | c394f652be9bb899f0abddbdce85447380c52c8a /src/DabMultiplexer.h | |
parent | 2ff1681e7df687d7f5046185388c0749f93b7f97 (diff) | |
download | dabmux-4205ff220c5f7dc71fedb93bce38bddc18aa5b5c.tar.gz dabmux-4205ff220c5f7dc71fedb93bce38bddc18aa5b5c.tar.bz2 dabmux-4205ff220c5f7dc71fedb93bce38bddc18aa5b5c.zip |
Rework counter and TIST initialisation to ensure TIST@FCT0 works correctly
This loses the continuity-across-restarts of the counter, but
most destinations already see a counter discontinuity now. So
it's not a big loss
Diffstat (limited to 'src/DabMultiplexer.h')
-rw-r--r-- | src/DabMultiplexer.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/DabMultiplexer.h b/src/DabMultiplexer.h index 5a0d906..07b42a1 100644 --- a/src/DabMultiplexer.h +++ b/src/DabMultiplexer.h @@ -45,15 +45,14 @@ constexpr uint32_t ETI_FSYNC1 = 0x49C5F8; class MuxTime { private: - uint32_t m_timestamp = 0; std::time_t m_edi_time = 0; - uint32_t m_tist_at_fct0_us = 0; + uint32_t m_pps_offset_ms = 0; + int64_t m_tist_offset_ms = 0; public: std::pair<uint32_t, std::time_t> get_tist_seconds(); std::pair<uint32_t, std::time_t> get_milliseconds_seconds(); - double tist_offset = 0; /* Pre v3 odr-dabmux did the MNSC calculation differently, * which works with the easydabv2. The rework in odr-dabmux, @@ -69,8 +68,10 @@ class MuxTime { std::time_t mnsc_time = 0; /* Setup the time and return the initial currentFrame counter value */ - uint64_t init(uint32_t tist_at_fct0_us); + uint64_t init(uint32_t tist_at_fct0_us, double tist_offset); void increment_timestamp(); + double tist_offset() const { return m_tist_offset_ms * 1000.0; } + void set_tist_offset(double new_tist_offset); }; class DabMultiplexer : public RemoteControllable { |