Package: dvb-utils
Version: 1.1.1-2
Severity: normal
Tags: patch

On Eurobird 28.5°E, there are several transponders with the same 
frequency but opposite polarisation. Because of this, scan ignores half 
of the transponders, or misassigns channels to the wrong polarity 
transponder.

Attached is a fix.
--- util/scan/scan.c.bak	2007-03-17 16:54:10.042630789 +0000
+++ util/scan/scan.c	2007-03-17 17:00:41.644111000 +0000
@@ -199,9 +199,12 @@
 	return tp;
 }
 
-static int is_same_transponder(uint32_t f1, uint32_t f2)
+static int is_same_transponder(uint32_t f1, enum polarisation p1,
+			       uint32_t f2, enum polarisation p2)
 {
 	uint32_t diff;
+        if (p1 != p2)
+                return 0;
 	if (f1 == f2)
 		return 1;
 	diff = (f1 > f2) ? (f1 - f2) : (f2 - f1);
@@ -213,7 +216,8 @@
 	return 0;
 }
 
-static struct transponder *find_transponder(uint32_t frequency)
+static struct transponder *find_transponder(uint32_t frequency,
+					    enum polarisation pol)
 {
 	struct list_head *pos;
 	struct transponder *tp;
@@ -222,12 +226,14 @@
 		tp = list_entry(pos, struct transponder, list);
 		if (current_tp_only)
 			return tp;
-		if (is_same_transponder(tp->param.frequency, frequency))
+		if (is_same_transponder(tp->param.frequency, tp->polarisation,
+					frequency, pol))
 			return tp;
 	}
 	list_for_each(pos, &new_transponders) {
 		tp = list_entry(pos, struct transponder, list);
-		if (is_same_transponder(tp->param.frequency, frequency))
+		if (is_same_transponder(tp->param.frequency, tp->polarisation,
+					frequency, pol))
 			return tp;
 	}
 	return NULL;
@@ -866,7 +872,7 @@
 
 		if (tn.type == fe_info.type) {
 			/* only add if develivery_descriptor matches FE type */
-			t = find_transponder(tn.param.frequency);
+			t = find_transponder(tn.param.frequency, tn.polarisation);
 			if (!t)
 				t = alloc_transponder(tn.param.frequency);
 			copy_transponder(t, &tn);
@@ -1545,7 +1551,7 @@
 			/* check if the alternate freqeuncy is really new to us */
 			freq = t->other_f[t->n_other_f - 1];
 			t->n_other_f--;
-			if (find_transponder(freq))
+			if (find_transponder(freq,0))
 				goto next;
 
 			/* remember tuning to the old frequency failed */

Reply via email to