1
0
Fork 0

Fix minor issues in checking of IF sample rate option.

This commit is contained in:
Joris van Rantwijk 2015-11-22 16:04:25 +01:00
parent e9fe05c4ea
commit d5dd2d9603
1 changed files with 4 additions and 3 deletions

View File

@ -219,7 +219,8 @@ void usage()
" -d devidx RTL-SDR device index, 'list' to show device list (default 0)\n" " -d devidx RTL-SDR device index, 'list' to show device list (default 0)\n"
" -g gain Set LNA gain in dB, or 'auto' (default auto)\n" " -g gain Set LNA gain in dB, or 'auto' (default auto)\n"
" -a Enable RTL AGC mode (default disabled)\n" " -a Enable RTL AGC mode (default disabled)\n"
" -s ifrate IF sample rate in Hz (default 1000000, valid range: [225001, 300000] U [900000, 3200000])\n" " -s ifrate IF sample rate in Hz (default 1000000)\n"
" (valid ranges: [225001, 300000], [900001, 3200000]))\n"
" -r pcmrate Audio sample rate in Hz (default 48000 Hz)\n" " -r pcmrate Audio sample rate in Hz (default 48000 Hz)\n"
" -M Disable stereo decoding\n" " -M Disable stereo decoding\n"
" -R filename Write audio data as raw S16_LE samples\n" " -R filename Write audio data as raw S16_LE samples\n"
@ -358,8 +359,8 @@ int main(int argc, char **argv)
// NOTE: RTL does not support some sample rates below 900 kS/s // NOTE: RTL does not support some sample rates below 900 kS/s
// Also, max sampling rate is 3.2 MS/s // Also, max sampling rate is 3.2 MS/s
if (!parse_dbl(optarg, ifrate) || if (!parse_dbl(optarg, ifrate) ||
(ifrate <= 225000) || (ifrate > 3200000) || (ifrate < 225001) || (ifrate > 3200000) ||
((ifrate > 300000) && (ifrate <= 900000))) { ((ifrate > 300000) && (ifrate < 900001))) {
badarg("-s"); badarg("-s");
} }
break; break;