[PATCH]Fix a bug in scan, which outputs the wrong frequency if the current tuned transponder is scanned only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

if the current tuned transponder is scanned only and the output needs the frequency of the
transponder, it is used the last frequency, which is found during the NIT scanning. This
is wrong. The attached patch will fix this problem.

Regards,
Hartmut


signed-off-by: Hartmut Birr <e9hack@xxxxxxxxxxxxxx>
diff -r afd0efc0f9d2 util/scan/scan.c
--- a/util/scan/scan.c	Mon Nov 10 16:32:50 2008 +0100
+++ b/util/scan/scan.c	Mon Nov 17 10:20:02 2008 +0100
@@ -221,8 +221,6 @@ static struct transponder *find_transpon
 
 	list_for_each(pos, &scanned_transponders) {
 		tp = list_entry(pos, struct transponder, list);
-		if (current_tp_only)
-			return tp;
 		if (is_same_transponder(tp->param.frequency, frequency))
 			return tp;
 	}
@@ -879,9 +877,10 @@ static void parse_nit (const unsigned ch
 		if (tn.type == fe_info.type) {
 			/* only add if develivery_descriptor matches FE type */
 			t = find_transponder(tn.param.frequency);
-			if (!t)
+			if (!t && !current_tp_only)
 				t = alloc_transponder(tn.param.frequency);
-			copy_transponder(t, &tn);
+			if (t)
+				copy_transponder(t, &tn);
 		}
 
 		section_length -= descriptors_loop_len + 6;
@@ -2284,7 +2283,10 @@ int main (int argc, char **argv)
 	signal(SIGINT, handle_sigint);
 
 	if (current_tp_only) {
-		current_tp = alloc_transponder(0); /* dummy */
+		struct dvb_frontend_parameters frontend_params;
+		if (ioctl(frontend_fd, FE_GET_FRONTEND, &frontend_params) < 0)
+			fatal("FE_GET_FRONTEND failed: %d %m\n", errno);
+		current_tp = alloc_transponder(frontend_params.frequency);
 		/* move TP from "new" to "scanned" list */
 		list_del_init(&current_tp->list);
 		list_add_tail(&current_tp->list, &scanned_transponders);
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux