print out exact sample rate only if needed

master
Dimitri Stolnikov 13 years ago
parent 94c47189d4
commit 2b0d5963b7
  1. 4
      src/rtl-sdr.c

@ -519,7 +519,9 @@ int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t samp_rate)
rsamp_ratio &= ~3; rsamp_ratio &= ~3;
real_rate = (CRYSTAL_FREQ * pow(2, 22)) / rsamp_ratio; real_rate = (CRYSTAL_FREQ * pow(2, 22)) / rsamp_ratio;
fprintf(stderr, "Setting sample rate: %.3f Hz\n", real_rate);
if ( ((double)samp_rate) != real_rate )
fprintf(stderr, "Exact sample rate: %f Hz\n", real_rate);
if (dev->tuner) if (dev->tuner)
dev->tuner->set_bw((void *)dev, real_rate); dev->tuner->set_bw((void *)dev, real_rate);

Loading…
Cancel
Save