aboutsummaryrefslogtreecommitdiffstats
path: root/console
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-23 04:48:10 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-04-23 05:30:45 (GMT)
commitecbdbf3b3caba3c9f3e09a50f7bdc77208dbb424 (patch)
tree3792d1901f37eedfddba0731a6736882eeff848c /console
parentb053b7fcd94987c950519a428aae96b2c300d4fb (diff)
Allow specifying an input with scantv
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'console')
-rw-r--r--console/scantv.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/console/scantv.c b/console/scantv.c
index 617eb13..5d96772 100644
--- a/console/scantv.c
+++ b/console/scantv.c
@@ -116,6 +116,7 @@ usage(FILE *out, char *prog, char *outfile)
"options:\n"
" -h print this text\n"
" -o outfile set output file. [%s]\n"
+ " -i input set input.\n"
" -n norm set tv norm.\n"
" -f table set frequency table.\n"
" -c device set video device file. [%s]\n"
@@ -137,6 +138,7 @@ main(int argc, char **argv)
unsigned int f,f1,f2,fc;
char *name,dummy[32];
char *tvnorm = NULL;
+ char *tvinput = NULL;
char *freqtab = NULL;
char *outfile = NULL;
FILE *conf = stdout;
@@ -144,7 +146,7 @@ main(int argc, char **argv)
/* parse options */
ng_init();
for (;;) {
- if (-1 == (c = getopt(argc, argv, "hsadn:f:o:c:C:")))
+ if (-1 == (c = getopt(argc, argv, "hsadi:n:f:o:c:C:")))
break;
switch (c) {
case 'd':
@@ -156,6 +158,9 @@ main(int argc, char **argv)
case 'a':
fullscan=1;
break;
+ case 'i':
+ tvinput = optarg;
+ break;
case 'n':
tvnorm = optarg;
break;
@@ -203,12 +208,15 @@ main(int argc, char **argv)
attr = ng_attr_byid(attrs,ATTR_ID_NORM);
i = menu("please select your TV norm",attr->choices,tvnorm);
j = menu("please select a frequency table",chanlist_names,freqtab);
+ if (tvinput == NULL) {
+ tvinput = "Television";
+ }
fprintf(conf,"[global]\n");
fprintf(conf,"freqtab = %s\n",chanlist_names[j].str);
fprintf(conf,"\n");
fprintf(conf,"[defaults]\n");
- fprintf(conf,"input = Television\n");
+ fprintf(conf,"input = %s\n", tvinput);
fprintf(conf,"norm = %s\n",ng_attr_getstr(attr,i));
fprintf(conf,"\n");
fflush(conf);
@@ -220,7 +228,7 @@ main(int argc, char **argv)
exit(0);
}
set_defaults();
- do_va_cmd(2,"setinput","television");
+ do_va_cmd(2,"setinput",tvinput);
do_va_cmd(2,"setnorm",ng_attr_getstr(attr,i));
do_va_cmd(2,"setfreqtab",chanlist_names[j].str);

Privacy Policy