diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-12-09 13:43:58 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-12-13 16:23:04 -0800 |
commit | d0a60fea5cf5ab2d1408059f998f355e273f11f1 (patch) | |
tree | f53f1cd3544f7702bb55db5fa614160a6ff4fac9 | |
parent | 582553984cfd70ae11f5c12da568e4a0a74888d2 (diff) | |
download | uhd-d0a60fea5cf5ab2d1408059f998f355e273f11f1.tar.gz uhd-d0a60fea5cf5ab2d1408059f998f355e273f11f1.tar.bz2 uhd-d0a60fea5cf5ab2d1408059f998f355e273f11f1.zip |
rfnoc: DDC block has some safeguards in get_output_samp_rate in case its called with ANY_PORT
-rw-r--r-- | host/lib/rfnoc/ddc_block_ctrl_impl.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/host/lib/rfnoc/ddc_block_ctrl_impl.cpp b/host/lib/rfnoc/ddc_block_ctrl_impl.cpp index 2aac22ca4..fb70b6f45 100644 --- a/host/lib/rfnoc/ddc_block_ctrl_impl.cpp +++ b/host/lib/rfnoc/ddc_block_ctrl_impl.cpp @@ -121,7 +121,15 @@ public: double get_output_samp_rate(size_t port=ANY_PORT) { - port = port == ANY_PORT ? 0 : port; + if (port == ANY_PORT) { + port = 0; + for (size_t i = 0; i < get_input_ports().size(); i++) { + if (_rx_streamer_active.count(i) and _rx_streamer_active.at(i)) { + port = i; + break; + } + } + } if (not (_rx_streamer_active.count(port) and _rx_streamer_active.at(port))) { return RATE_UNDEFINED; } |