diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-01-14 07:52:24 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-01-14 07:52:24 +0100 |
commit | 9f862c4300018a1f6eb218746ec8131275455875 (patch) | |
tree | 1a077eb5fc045f197c3ff21f3590a4b605affb83 /src | |
parent | 016fa0af99a0edf2560d0faafcd212b3c4d48732 (diff) | |
download | dabmod-9f862c4300018a1f6eb218746ec8131275455875.tar.gz dabmod-9f862c4300018a1f6eb218746ec8131275455875.tar.bz2 dabmod-9f862c4300018a1f6eb218746ec8131275455875.zip |
UHD: avoid underrun when manual muting
Diffstat (limited to 'src')
-rw-r--r-- | src/output/UHD.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/output/UHD.cpp b/src/output/UHD.cpp index 4816f34..b5c3ae3 100644 --- a/src/output/UHD.cpp +++ b/src/output/UHD.cpp @@ -270,12 +270,14 @@ void UHD::transmit_frame(const struct FrameData& frame) size_t usrp_max_num_samps = m_tx_stream->get_max_num_samps(); size_t num_acc_samps = 0; //number of accumulated samples - while (m_running.load() and (not m_conf.muting) and (num_acc_samps < sizeIn)) { + while (m_running.load() and (num_acc_samps < sizeIn)) { size_t samps_to_send = std::min(sizeIn - num_acc_samps, usrp_max_num_samps); + const bool eob_because_muting = m_conf.muting; + // ensure the the last packet has EOB set if the timestamps has been // refreshed and need to be reconsidered. - md_tx.end_of_burst = ( + md_tx.end_of_burst = eob_because_muting or ( frame.ts.timestamp_valid and frame.ts.timestamp_refresh and samps_to_send <= usrp_max_num_samps ); @@ -296,6 +298,10 @@ void UHD::transmit_frame(const struct FrameData& frame) "OutputUHD unable to write to device, skipping frame!"); break; } + + if (eob_because_muting) { + break; + } } } |