Stefan Grönroos 2016-01-05 15:18:46 +00:00
commit bde101cecf
1 zmienionych plików z 18 dodań i 2 usunięć

Wyświetl plik

@ -95,7 +95,8 @@ void usage(void)
"\t[-b number of buffers (default: 15, set by library)]\n"
"\t[-n max number of linked list buffers to keep (default: 500)]\n"
"\t[-d device index (default: 0)]\n"
"\t[-P ppm_error (default: 0)]\n");
"\t[-P ppm_error (default: 0)]\n"
"\t[-N no dithering (default: use dithering)]\n");
exit(1);
}
@ -371,6 +372,7 @@ int main(int argc, char **argv)
int gain = 0;
int ppm_error = 0;
int custom_ppm = 0;
int dithering = 1;
struct llist *curelem,*prev;
pthread_attr_t attr;
void *status;
@ -388,7 +390,7 @@ int main(int argc, char **argv)
struct sigaction sigact, sigign;
#endif
while ((opt = getopt(argc, argv, "a:p:f:g:s:b:n:d:P:")) != -1) {
while ((opt = getopt(argc, argv, "a:p:f:g:s:b:n:d:P:N")) != -1) {
switch (opt) {
case 'd':
dev_index = verbose_device_search(optarg);
@ -419,6 +421,9 @@ int main(int argc, char **argv)
ppm_error = atoi(optarg);
custom_ppm = 1;
break;
case 'N':
dithering = 0;
break;
default:
usage();
break;
@ -455,6 +460,17 @@ int main(int argc, char **argv)
SetConsoleCtrlHandler( (PHANDLER_ROUTINE) sighandler, TRUE );
#endif
/* Enable/disable dithering */
if (!dithering) {
fprintf(stderr, "Disabling dithering... ");
r = rtlsdr_set_dithering(dev, dithering);
if (r) {
fprintf(stderr, "failure\n");
} else {
fprintf(stderr, "success\n");
}
}
/* Set the tuner error */
if (!custom_ppm) {
verbose_ppm_eeprom(dev, &ppm_error);