diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-10 12:05:13 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2021-02-10 12:05:13 +0100 |
commit | cb5100462f22e5575da3486f8b9735556b2c85e2 (patch) | |
tree | 892bebbf9527074bfa364d31eeceea109649d48f /contrib/edioutput | |
parent | ce2a1da06943d3fada9cbbcfbacbd9fc6ecd0874 (diff) | |
download | ODR-AudioEnc-cb5100462f22e5575da3486f8b9735556b2c85e2.tar.gz ODR-AudioEnc-cb5100462f22e5575da3486f8b9735556b2c85e2.tar.bz2 ODR-AudioEnc-cb5100462f22e5575da3486f8b9735556b2c85e2.zip |
Common 64b6f10: Fix UDP EDI packet output spreading
Diffstat (limited to 'contrib/edioutput')
-rw-r--r-- | contrib/edioutput/Transport.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/edioutput/Transport.cpp b/contrib/edioutput/Transport.cpp index cfed9ec..f8e5dc7 100644 --- a/contrib/edioutput/Transport.cpp +++ b/contrib/edioutput/Transport.cpp @@ -132,11 +132,14 @@ void Sender::write(const TagPacket& tagpacket) edi_fragments.size()); } - /* Spread out the transmission of all fragments over 75% of the 24ms AF packet duration - * to reduce the risk of losing fragments because of congestion. + /* Spread out the transmission of all fragments over 25% of the 24ms AF packet duration + * to reduce the risk of losing a burst of fragments because of congestion. * - * 75% was chosen so that other outputs still have time to do their thing. */ - const auto inter_fragment_wait_time = std::chrono::microseconds(llrint(0.75 * 24000.0 / edi_fragments.size())); + * 25% was chosen so that other outputs still have time to do their thing. */ + auto inter_fragment_wait_time = std::chrono::microseconds(0); + if (edi_fragments.size() > 1) { + inter_fragment_wait_time = std::chrono::microseconds(llrint(0.25 * 24000.0 / edi_fragments.size())); + } // Send over ethernet for (auto& edi_frag : edi_fragments) { |