aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri Stolnikov <horiz0n@gmx.net>2012-05-26 20:09:01 +0200
committerDimitri Stolnikov <horiz0n@gmx.net>2012-05-26 20:09:01 +0200
commitbcb8f2b28a281520da1181a2463d1e827ffa15bc (patch)
tree9aaa5aeff9e465abb025f2e3db0f67723231a3a3
parent932d6a6fb2e574d395484206f3bcfaf542981ec5 (diff)
cache real sample rate with 1Hz resolution instead of the desired rate
-rw-r--r--src/librtlsdr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librtlsdr.c b/src/librtlsdr.c
index 6c3a11c..9576d5c 100644
--- a/src/librtlsdr.c
+++ b/src/librtlsdr.c
@@ -102,7 +102,6 @@ int e4000_set_bw(void *dev, int bw) {
return 0;
}
int e4000_set_gain(void *dev, int gain) {
- int rc;
rtlsdr_dev_t* devt = (rtlsdr_dev_t*)dev;
int mixgain = (gain > 340) ? 12 : 4;
int enhgain = (gain - 420);
@@ -744,11 +743,11 @@ int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate)
if (dev->tuner && dev->tuner->set_bw) {
rtlsdr_set_i2c_repeater(dev, 1);
- dev->tuner->set_bw(dev, real_rate);
+ dev->tuner->set_bw(dev, (int)real_rate);
rtlsdr_set_i2c_repeater(dev, 0);
}
- dev->rate = samp_rate;
+ dev->rate = (uint32_t)real_rate;
tmp = (rsamp_ratio >> 16);
rtlsdr_demod_write_reg(dev, 1, 0x9f, tmp, 2);