[linux-dvb] [PATCH] Uniquely identify unknown services

David Engel gigem at comcast.net
Thu Aug 18 04:33:35 CEST 2005


Here's a very simple patch to scan that I've found useful while
playing around with my new Fusion HDTV card.  If scan detects a
service that can't be named, it generates one based on the service_id.
This can leas to duplicate names in the resulting channels file if
unnamed services are found on different frequencies with the same
service_id.  This patch remedies the problem by prefixing each
generated name with a unique number.

David
-- 
David Engel
gigem at comcast.net


Index: util/scan/scan.c
===================================================================
RCS file: /cvs/linuxtv/dvb-apps/util/scan/scan.c,v
retrieving revision 1.17
diff -u -r1.17 scan.c
--- util/scan/scan.c	10 May 2005 21:26:12 -0000	1.17
+++ util/scan/scan.c	18 Aug 2005 02:25:42 -0000
@@ -1905,6 +1905,7 @@
 	struct service *s;
 	int n = 0, i;
 	char sn[20];
+        int anon_services = 0;
 
 	list_for_each(p1, &scanned_transponders) {
 		t = list_entry(p1, struct transponder, list);
@@ -1925,8 +1926,10 @@
 
 			if (!s->service_name) {
 				/* not in SDT */
-				snprintf(sn, sizeof(sn), "[%04x]", s->service_id);
+				snprintf(sn, sizeof(sn), "[%03x-%04x]", 
+                                         anon_services, s->service_id);
 				s->service_name = strdup(sn);
+				anon_services++;
 			}
 			/* ':' is field separator in szap and vdr service lists */
 			for (i = 0; s->service_name[i]; i++) {




More information about the linux-dvb mailing list