summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-24 10:26:32 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-24 10:26:32 +0100
commit9fe15716d3aeff387f4dbb7e85ebe22ac5755447 (patch)
treee9a53b8a7de7cb4c788d43ff11dd6004c14b65e5 /lib
parent37133dceeb541c42a02390e9a461d7c2802e6841 (diff)
downloaddabmux-9fe15716d3aeff387f4dbb7e85ebe22ac5755447.tar.gz
dabmux-9fe15716d3aeff387f4dbb7e85ebe22ac5755447.tar.bz2
dabmux-9fe15716d3aeff387f4dbb7e85ebe22ac5755447.zip
Pull common efe0a08
Diffstat (limited to 'lib')
-rw-r--r--lib/edi/common.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/edi/common.cpp b/lib/edi/common.cpp
index e4a51b4..134e14b 100644
--- a/lib/edi/common.cpp
+++ b/lib/edi/common.cpp
@@ -103,7 +103,10 @@ std::chrono::system_clock::time_point frame_timestamp_t::to_system_clock() const
auto ts = chrono::system_clock::from_time_t(to_unix_epoch());
// PPS offset in seconds = tsta / 16384000
- ts += chrono::nanoseconds(std::lrint(tsta / 0.016384));
+ // We cannot use nanosecond resolution because not all platforms use a
+ // system_clock that has nanosecond precision. It's not really important,
+ // as this function is only used for debugging.
+ ts += chrono::microseconds(std::lrint(tsta / 16.384));
return ts;
}