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>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@6739 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
Thomas Tsou
2013-10-17 06:18:36 +00:00
parent abc5f65b0e
commit 58d1896ae8

View File

@@ -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