diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-04-27 13:43:22 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-04-27 13:43:22 +0200 |
commit | f0bb1e24952c7e261ba13907c0a5d8c3e1d198ca (patch) | |
tree | 08992867c48cc4daf8841275969d484497e34c1d /src/output/SDR.cpp | |
parent | 830fb3ab0a8631055b2341b8dac50b937b6e99bb (diff) | |
download | dabmod-f0bb1e24952c7e261ba13907c0a5d8c3e1d198ca.tar.gz dabmod-f0bb1e24952c7e261ba13907c0a5d8c3e1d198ca.tar.bz2 dabmod-f0bb1e24952c7e261ba13907c0a5d8c3e1d198ca.zip |
Improve dexter clock handling
Diffstat (limited to 'src/output/SDR.cpp')
-rw-r--r-- | src/output/SDR.cpp | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp index 860d8ed..11321f2 100644 --- a/src/output/SDR.cpp +++ b/src/output/SDR.cpp @@ -258,44 +258,19 @@ const char* SDR::name() return m_name.c_str(); } -void SDR::sleep_through_frame() -{ - using namespace std::chrono; - - const auto now = steady_clock::now(); - - if (not t_last_frame_initialised) { - t_last_frame = now; - t_last_frame_initialised = true; - } - - const auto delta = now - t_last_frame; - const auto wait_time = transmission_frame_duration(m_config.dabMode); - - if (wait_time > delta) { - this_thread::sleep_for(wait_time - delta); - } - - t_last_frame += wait_time; -} void SDR::handle_frame(struct FrameData&& frame) { // Assumes m_device is valid if (not m_device->is_clk_source_ok()) { - sleep_through_frame(); return; } const auto& time_spec = frame.ts; - if (m_config.enableSync and m_config.muteNoTimestamps and - not time_spec.timestamp_valid) { - sleep_through_frame(); - etiLog.log(info, - "OutputSDR: Muting sample %d : no timestamp\n", - frame.ts.fct); + if (m_config.enableSync and m_config.muteNoTimestamps and not time_spec.timestamp_valid) { + etiLog.log(info, "OutputSDR: Muting sample %d : no timestamp\n", frame.ts.fct); return; } |