aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-15 10:45:46 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2021-02-15 10:45:46 +0100
commit02650f3f087ae3cc9fd6ae0aaf011aea2bf177df (patch)
tree67524c29877a5ccd46e47d916b0c2ae355b61a9a /src/main.cpp
parent6bfd16f561c292fec0b42316f3c22d901ef038ed (diff)
downloadODR-EDI2EDI-02650f3f087ae3cc9fd6ae0aaf011aea2bf177df.tar.gz
ODR-EDI2EDI-02650f3f087ae3cc9fd6ae0aaf011aea2bf177df.tar.bz2
ODR-EDI2EDI-02650f3f087ae3cc9fd6ae0aaf011aea2bf177df.zip
Common fc2902b: Replace EDI interleaver by improved EDI spreading
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 698f8e3..43d8cab 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -69,7 +69,7 @@ static void usage()
cerr << " -x Drop frames where for which the wait time would be negative, i.e. frames that arrived too late.\n";
cerr << " -P Disable PFT and send AFPackets.\n";
cerr << " -f <fec> Set the FEC.\n";
- cerr << " -i <interleave> Enable the interleaver with this latency.\n";
+ cerr << " -i <interleave> Configure the interleaver with given interleave percentage: 0% send all fragments at once, 100% spread over 24ms, >100% spread and interleave. Default 95%\n";
cerr << " -D Dump the EDI to edi.debug file.\n";
cerr << " -v Enables verbose mode.\n";
cerr << " -a <alignement> Set the alignment of the TAG Packet (default 8).\n";
@@ -171,18 +171,13 @@ class Main : public EdiDecoder::ETIDataCollector {
break;
case 'i':
{
- double interleave_ms = std::stod(optarg);
- if (interleave_ms != 0.0) {
- if (interleave_ms < 0) {
+ int interleave_percent = std::stoi(optarg);
+ if (interleave_percent != 0) {
+ if (interleave_percent < 0) {
throw std::runtime_error("EDI output: negative interleave value is invalid.");
}
- auto latency_rounded = lround(interleave_ms / 24.0);
- if (latency_rounded * 24 > 30000) {
- throw std::runtime_error("EDI output: interleaving set for more than 30 seconds!");
- }
-
- edi_conf.latency_frames = latency_rounded;
+ edi_conf.fragment_spreading_factor = (double)interleave_percent / 100.0;
}
}
break;