summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2022-08-19 17:12:54 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2022-08-19 17:18:09 +0200
commit913cd43139d7b5d6eac166a01ac09a754f2bd013 (patch)
tree98a7bb16c4a05bd7da8aa0fcd25d7620723b999d /src
parent7bfb88a7446e7faaee6e297e915a2bf95a699109 (diff)
downloaddabmux-913cd43139d7b5d6eac166a01ac09a754f2bd013.tar.gz
dabmux-913cd43139d7b5d6eac166a01ac09a754f2bd013.tar.bz2
dabmux-913cd43139d7b5d6eac166a01ac09a754f2bd013.zip
Support EDI TCP server pre-roll on client connect
Includes common code changes: socket changes for keepalive and preroll
Diffstat (limited to 'src')
-rw-r--r--src/DabMux.cpp7
-rw-r--r--src/dabOutput/dabOutputTcp.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 3938131..4373265 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -3,7 +3,7 @@
2011, 2012 Her Majesty the Queen in Right of Canada (Communications
Research Center Canada)
- Copyright (C) 2019
+ Copyright (C) 2022
Matthias P. Braendli, matthias.braendli@mpb.li
http://www.opendigitalradio.org
@@ -355,6 +355,11 @@ int main(int argc, char *argv[])
}
}
+ const auto tist_offset = pt.get<int>("general.tist_offset", 0);
+ // By keeping 1.5 x tist_offset worth of EDI in the pre-roll buffer, we ensure that a new client can
+ // immediately send out frames according to their timestamp.
+ edi_conf.tcp_server_preroll_buffers = ceil(1.5 * (tist_offset / 24e-3));
+
edi_conf.dump = pt_edi.get<bool>("dump", false);
edi_conf.enable_pft = pt_edi.get<bool>("enable_pft", false);
edi_conf.verbose = pt_edi.get<bool>("verbose", false);
diff --git a/src/dabOutput/dabOutputTcp.cpp b/src/dabOutput/dabOutputTcp.cpp
index 4dc3538..6453200 100644
--- a/src/dabOutput/dabOutputTcp.cpp
+++ b/src/dabOutput/dabOutputTcp.cpp
@@ -94,7 +94,7 @@ int DabOutputTcp::Open(const char* name)
uri_ = name;
if (success) {
- dispatcher_ = make_shared<Socket::TCPDataDispatcher>(MAX_QUEUED_ETI_FRAMES);
+ dispatcher_ = make_shared<Socket::TCPDataDispatcher>(MAX_QUEUED_ETI_FRAMES, 0);
dispatcher_->start(port, address);
}
else {