summaryrefslogtreecommitdiffstats
path: root/src/DabMux.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-22 16:28:37 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-22 16:29:07 +0100
commit220549b9980f1e15c1299084fb06a0df4ab5f2cf (patch)
tree65fec643551902f5b9d68fed22224a487d273d0b /src/DabMux.cpp
parent26065b4193006401f78a4afdf4e19cbd1db6c593 (diff)
downloaddabmux-220549b9980f1e15c1299084fb06a0df4ab5f2cf.tar.gz
dabmux-220549b9980f1e15c1299084fb06a0df4ab5f2cf.tar.bz2
dabmux-220549b9980f1e15c1299084fb06a0df4ab5f2cf.zip
Update configuration and compilation for new EDI UDP packet interleaver
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r--src/DabMux.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 4265412..70eee69 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -362,18 +362,17 @@ int main(int argc, char *argv[])
edi_conf.fec = pt_edi.get<unsigned int>("fec", 3);
edi_conf.chunk_len = pt_edi.get<unsigned int>("chunk_len", 207);
- double interleave_ms = pt_edi.get<double>("interleave", 0);
- if (interleave_ms != 0.0) {
- if (interleave_ms < 0) {
- throw runtime_error("EDI output: negative interleave value is invalid.");
+ int spread_percent = pt_edi.get<int>("packet_spread", 95);
+ if (spread_percent != 0) {
+ if (spread_percent < 0) {
+ throw std::runtime_error("EDI output: negative packet_spread value is invalid.");
}
- auto latency_rounded = lround(interleave_ms / 24.0);
- if (latency_rounded * 24 > 30000) {
- throw runtime_error("EDI output: interleaving set for more than 30 seconds!");
- }
+ edi_conf.fragment_spreading_factor = (double)spread_percent / 100.0;
- edi_conf.latency_frames = latency_rounded;
+ if (edi_conf.fragment_spreading_factor > 30000) {
+ throw std::runtime_error("EDI output: interleaving set for more than 30 seconds!");
+ }
}
edi_conf.tagpacket_alignment = pt_edi.get<unsigned int>("tagpacket_alignment", 8);