[scan patch] do not set ca field to 1 for vdr

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

 



Since VDR 1.3 series (released about 3-5 years ago I think), VDR updates the ca field of channels.conf entry automatically. However, value "1" has a special meaning to VDR. It will force the use of DVB card 1 to receive the channel, and will not update the ca field to its proper value.

However, scan defaults to setting ca value to 1 on encrypted channels, which does not make sense.

The attached patch adds a new default value "-1" to "-x" parameter and sets vdr default version to "3" instead of the now obsolete "2". With the new value "-1" scan will set ca field of all channels to "0" and let VDR update the field properly.

--
Anssi Hannula
diff -r 4bca5d49c9bd util/scan/dump-vdr.c
--- a/util/scan/dump-vdr.c	Tue Sep 11 21:32:03 2007 +0200
+++ b/util/scan/dump-vdr.c	Sat Sep 22 19:34:14 2007 +0300
@@ -138,7 +138,7 @@ void vdr_dump_service_parameter_set (FIL
 {
         int i;
 
-	if ((video_pid || audio_pid[0]) && ((ca_select > 0) || ((ca_select == 0) && (scrambled == 0)))) {
+	if (video_pid || audio_pid[0]) {
 		if (vdr_version <= 2) {
 			audio_lang = NULL;
 			network_id = 0;
@@ -174,7 +174,15 @@ void vdr_dump_service_parameter_set (FIL
 			if (audio_lang && audio_lang[0][0])
 				fprintf (f, "=%.4s", audio_lang[0]);
  		}
-		if (scrambled == 1) scrambled = ca_select;
+		if (scrambled == 1) {
+			if (ca_select == -1)
+				if (vdr_version <= 2)
+					scrambled = 1;
+				else
+					scrambled = 0;
+			else
+				scrambled = ca_select;
+		}
 		fprintf (f, ":%d:%d:%d:%d:%d:0", teletext_pid, scrambled,
 				service_id, network_id, transport_stream_id);
 		fprintf (f, "\n");
diff -r 4bca5d49c9bd util/scan/scan.c
--- a/util/scan/scan.c	Tue Sep 11 21:32:03 2007 +0200
+++ b/util/scan/scan.c	Sat Sep 22 19:46:02 2007 +0300
@@ -61,9 +61,9 @@ static int vdr_dump_channum;
 static int vdr_dump_channum;
 static int no_ATSC_PSIP;
 static int ATSC_type=1;
-static int ca_select = 1;
+static int ca_select = -1;
 static int serv_select = 7;
-static int vdr_version = 2;
+static int vdr_version = 3;
 static struct lnb_types_st lnb_type;
 static int unique_anon_services;
 
@@ -2082,14 +2082,15 @@ static const char *usage = "\n"
 	"	-5	multiply all filter timeouts by factor 5\n"
 	"		for non-DVB-compliant section repitition rates\n"
 	"	-o fmt	output format: 'zap' (default), 'vdr' or 'pids' (default with -c)\n"
-	"	-x N	Conditional Axcess, (default 1)\n"
+	"	-x N	Conditional Access, (default -1)\n"
 	"		N=0 gets only FTA channels\n"
+	"		N=-1 gets all channels\n"
 	"		N=xxx sets ca field in vdr output to :xxx:\n"
 	"	-t N	Service select, Combined bitfield parameter.\n"
 	"		1 = TV, 2 = Radio, 4 = Other, (default 7)\n"
 	"	-p	for vdr output format: dump provider name\n"
-	"	-e N	VDR version, default 2 for VDR-1.2.x\n"
-	"		ANYTHING ELSE GIVES NONZERO NIT and TID\n"
+	"	-e N	VDR version, default 3 for VDR-1.3.x and newer\n"
+	"		value 2 sets NIT and TID to zero\n"
 	"		Vdr version 1.3.x and up implies -p.\n"
 	"	-l lnb-type (DVB-S Only) (use -l help to print types) or \n"
 	"	-l low[,high[,switch]] in Mhz\n"
_______________________________________________
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