aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2013-08-22 18:26:06 -0400
committerThomas Tsou <tom@tsou.cc>2013-10-18 13:10:17 -0400
commit84c60f6679d3569b74121f3f616c1f1e36dc44ce (patch)
treee238378e7d67c3796aa7f006ebb8cdd339a42159
parent865bca42d6f93f542224026fc0b9dddfc9486223 (diff)
Transceiver52M: Check that sample rates are sane before using
If there is an error in the sample rate determination, noted by a negative return sample rate value, error directly and don't try to set the device rate. Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r--Transceiver52M/UHDDevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index 8206d3a..34dd88a 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -550,7 +550,7 @@ int uhd_device::open(const std::string &args)
// Set rates
desired_smpl_rt = select_rate(dev_type, sps);
- if (set_rates(desired_smpl_rt) < 0)
+ if ((desired_smpl_rt > 0.0) && (set_rates(desired_smpl_rt) < 0))
return -1;
// Create receive buffer