[mythtv] DVB Development - Code for help in debugging

Duncan Charlton lists-dpc-dc-rw at duncancharlton.com
Sun May 23 18:55:45 EDT 2004


Hi,

I've subsequently found a few more incorrect fields in 
ParseDescriptorTerrestrialDeliverySystem().

Attached diff includes my previous diff and corrects the other fields 
(most of which aren't currently displayed)

The NIT output of mythscan for DVB-T now gives me the same values as the 
'scan' app in linuxtv-dvb-1.0.0 (which are the ones I'm currently using 
in the dvbchannel table in mythconverg).

Apologies for inconviences caused by me being too hasty with my last email.

I'll see if I can get anything out of the EIT but I don't think we have 
much in the way of guide data on DVB-T in the UK at the moment.

Cheers

Duncan



-------------- next part --------------
--- mythscan.cpp.orig	2004-05-23 22:32:56.000000000 +0100
+++ mythscan.cpp	2004-05-23 23:15:02.000000000 +0100
@@ -163,15 +163,11 @@
     retval.Type = QString("DVB-T");
 
     // Frequency
-    retval.Frequency=QString("%1%2%3%4%5%6%7%8")
-             .arg((buffer[2] & 0xF0) >> 4)
-             .arg( buffer[2] & 0x0F)
-             .arg((buffer[3] & 0xF0) >> 4)
-             .arg( buffer[3] & 0x0F)
-             .arg((buffer[4] & 0xF0) >> 4)
-             .arg( buffer[4] & 0x0F)
-             .arg((buffer[5] & 0xF0) >> 4)
-             .arg( buffer[5] & 0x0F);
+    retval.Frequency=QString("%1")
+        .arg(
+             (buffer[2]<<24 | buffer[3]<<16 | 
+              buffer[4] << 8 | buffer[5])*10
+             );
 
     // Bandwidth
     switch ((buffer[6] & 0xE0) >> 5) {
@@ -190,7 +186,7 @@
     }
 
     // Consetelation
-    switch ((buffer[7] & 0xC0) >> 5) {
+    switch ((buffer[7] & 0xC0) >> 6) {
        case 0:
                retval.Modulation = "QPSK";
                break;
@@ -226,77 +222,80 @@
         
     // CoderateHP
     switch (buffer[7] & 0x03) {
-    	case 1:
+    	case 0:
     	        retval.CodeRateHP = "1/2";
     	        break;
-    	case 2:
+    	case 1:
     	        retval.CodeRateHP = "2/3";
     	        break;
-    	case 3:
+    	case 2:
     	        retval.CodeRateHP = "3/4";
     	        break;
-    	case 4:
+    	case 3:
     	        retval.CodeRateHP = "5/6";
     	        break;
-    	case 5:
+    	case 4:
     	        retval.CodeRateHP = "7/8";
     	        break;
-    	case 6:
+    	default:
     	        retval.CodeRateHP = "unknown";
     	        break;
     }
     
     // CoderateLP
-    switch ((buffer[8] & 0xC0) >> 5) {
-    	case 1:
+    switch ((buffer[8] & 0xE0) >> 5) {
+    	case 0:
     	        retval.CodeRateLP = "1/2";
     	        break;
-    	case 2:
+    	case 1:
     	        retval.CodeRateLP = "2/3";
     	        break;
-    	case 3:
+    	case 2:
     	        retval.CodeRateLP = "3/4";
     	        break;
-    	case 4:
+    	case 3:
     	        retval.CodeRateLP = "5/6";
     	        break;
-    	case 5:
+    	case 4:
     	        retval.CodeRateLP = "7/8";
     	        break;
-    	case 6:
+    	default:
     	        retval.CodeRateLP = "unknown";
     	        break;
     }    
     
     //Guard Interval
     switch ((buffer[8] & 0x18) >> 3) {
-    	case 1:
+    	case 0:
     	        retval.GuardInterval = "1/32";
     	        break;
-    	case 2:
+    	case 1:
     	        retval.GuardInterval = "1/16";
     	        break;
-    	case 3:
+    	case 2:
     	        retval.GuardInterval = "1/8";
     	        break;
-    	case 4:
+    	case 3:
     	        retval.GuardInterval = "1/4";
     	        break;
+    	default:
+    	        retval.GuardInterval = "unknown";
+    	        break;
     } 
        
     //TransmissionMode
     switch ((buffer[8] & 0x06) >> 1) {
-    	case 1:
+    	case 0:
     	        retval.TransmissionMode = "2k";
     	        break;
-    	case 2:
+    	case 1:
     	        retval.TransmissionMode = "8k";
     	        break;
     	default:
     	        retval.TransmissionMode = "unknown";
     	        break;
     }    
-    
+
     return retval;
 	
 }


More information about the mythtv-dev mailing list