summaryrefslogtreecommitdiffstats
path: root/src/ManagementServer.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-10 12:04:23 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-10 12:04:23 +0100
commit97458a2e08d5bf4904553eb76467fb047e4719f4 (patch)
tree41376d5827a576e7917b98a5ceb4acc9779cae2e /src/ManagementServer.cpp
parent9719087ebcb4bd422c592f994f2e1691191e91d6 (diff)
downloaddabmux-97458a2e08d5bf4904553eb76467fb047e4719f4.tar.gz
dabmux-97458a2e08d5bf4904553eb76467fb047e4719f4.tar.bz2
dabmux-97458a2e08d5bf4904553eb76467fb047e4719f4.zip
Add timestamp offset to management server for EDI input
Diffstat (limited to 'src/ManagementServer.cpp')
-rw-r--r--src/ManagementServer.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/ManagementServer.cpp b/src/ManagementServer.cpp
index f3b72d9..599d744 100644
--- a/src/ManagementServer.cpp
+++ b/src/ManagementServer.cpp
@@ -336,7 +336,8 @@ void ManagementServer::handle_message(zmq::message_t& zmq_message)
}
std::string answerstr(answer.str());
- m_zmq_sock.send(answerstr.c_str(), answerstr.size());
+ zmq::const_buffer message(answerstr.data(), answerstr.size());
+ m_zmq_sock.send(message, zmq::send_flags::none);
}
catch (const std::exception& e) {
etiLog.level(error) <<
@@ -382,6 +383,13 @@ void InputStat::notifyBuffer(long bufsize)
prune_statistics(time_now);
}
+void InputStat::notifyTimestampOffset(double offset)
+{
+ unique_lock<mutex> lock(m_mutex);
+
+ m_last_tist_offset = offset;
+}
+
void InputStat::notifyPeakLevels(int peak_left, int peak_right)
{
unique_lock<mutex> lock(m_mutex);
@@ -558,6 +566,7 @@ std::string InputStat::encodeValuesJSON()
"\"peak_right_slow\": " << to_dB(peak_right) << ", "
"\"num_underruns\": " << m_num_underruns << ", "
"\"num_overruns\": " << m_num_overruns << ", "
+ "\"last_tist_offset\": " << m_last_tist_offset << ", "
"\"version\": \"" << version << "\", "
"\"uptime\": " << m_uptime_s << ", "
;