public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: e9hack <e9hack@googlemail.com>
To: linux-dvb@linuxtv.org
Subject: [linux-dvb] [PATCH]Fix a bug in scan, which outputs the wrong frequency if the current tuned transponder is scanned only
Date: Mon, 17 Nov 2008 13:51:36 +0100	[thread overview]
Message-ID: <492168D8.4050900@googlemail.com> (raw)

[-- 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

             reply	other threads:[~2008-11-17 12:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 12:51 e9hack [this message]
2008-12-02 16:34 ` [linux-dvb] [PATCH]Fix a bug in scan, which outputs the wrong frequency if the current tuned transponder is scanned only 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=492168D8.4050900@googlemail.com \
    --to=e9hack@googlemail.com \
    --cc=linux-dvb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox