aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/xawtv/xawtv-3.95/14_scantv_input_override.patch
blob: 5439aebcd6d805dd088f972c63452b0be7f7d9aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
diff -urNad xawtv-3.95.dfsg.1~/console/scantv.c xawtv-3.95.dfsg.1/console/scantv.c
--- xawtv-3.95.dfsg.1~/console/scantv.c	2005-09-30 12:07:02.000000000 +0200
+++ xawtv-3.95.dfsg.1/console/scantv.c	2007-08-15 17:47:02.000483826 +0200
@@ -116,6 +116,7 @@
 	    "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 @@
     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 @@
     /* 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 @@
 	case 'a':
 	    fullscan=1;
 	    break;
+	case 'i':
+	    tvinput = optarg;
+	    break;
 	case 'n':
 	    tvnorm = optarg;
 	    break;
@@ -203,12 +208,15 @@
     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 @@
 	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);