public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [linux-dvb] [PATCH]Fix a bug in scan, which outputs the wrong frequency if the current tuned transponder is scanned only
@ 2008-11-17 12:51 e9hack
  2008-12-02 16:34 ` Christoph Pfister
  0 siblings, 1 reply; 14+ messages in thread
From: e9hack @ 2008-11-17 12:51 UTC (permalink / raw)
  To: linux-dvb

[-- Attachment #1: Type: text/plain, Size: 257 bytes --]

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



[-- Attachment #2: scan_fix_current_transponder_only.diff --]
[-- Type: text/x-diff, Size: 1437 bytes --]

signed-off-by: Hartmut Birr <e9hack@googlemail.com>
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);

[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-12-08 21:00 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17 12:51 [linux-dvb] [PATCH]Fix a bug in scan, which outputs the wrong frequency if the current tuned transponder is scanned only e9hack
2008-12-02 16:34 ` Christoph Pfister
2008-12-02 16:49   ` Alex Betis
2008-12-02 19:43     ` e9hack
2008-12-02 20:05       ` Alex Betis
2008-12-02 22:07         ` e9hack
2008-12-03  7:23           ` Alex Betis
2008-12-03 17:13             ` e9hack
2008-12-03 19:04               ` e9hack
2008-12-03 21:28                 ` Alex Betis
2008-12-08 20:21                   ` e9hack
2008-12-08 20:36                     ` Alex Betis
2008-12-08 21:00                       ` e9hack
2008-12-02 19:22   ` e9hack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox