diff -Naur atscepg-0.1.0.org/atscepg.cpp atscepg-0.1.0/atscepg.cpp --- atscepg-0.1.0.org/atscepg.cpp 2007-12-28 00:01:23.000000000 -0500 +++ atscepg-0.1.0/atscepg.cpp 2008-01-20 16:26:16.000000000 -0500 @@ -221,7 +221,8 @@ { cChannel* c = Channels.GetByNumber(ChannelNumber); if (c) { - if (c->Modulation() == 7/*VSB_8*/ && ChannelNumber != lastChannel) + fprintf(stdout,"Modulation=%d\n",c->Modulation()); + if ((c->Modulation() == 7/*VSB_8*/ || c->Modulation() == 5 /*QAM256*/) && ChannelNumber != lastChannel) { lastChannel = ChannelNumber; cATSCFilter::Instance()->Attach( (cDevice*) Device, c); diff -Naur atscepg-0.1.0.org/filter.cpp atscepg-0.1.0/filter.cpp --- atscepg-0.1.0.org/filter.cpp 2007-12-28 00:03:49.000000000 -0500 +++ atscepg-0.1.0/filter.cpp 2008-01-19 16:49:25.000000000 -0500 @@ -154,8 +154,14 @@ dprint(L_MSG, "Received MGT: new version, updating (%d -> %d).", getMGTVersion(), newVersion); if (!mgt) mgt = new MGT(Data); - else - mgt->update(Data); + else + mgt->update(Data); + + if (mgt->getCRCFailed()) { + delete mgt; + mgt = NULL; + return; + } setMGTVersion(newVersion); updateTables = true; diff -Naur atscepg-0.1.0.org/scanner.cpp atscepg-0.1.0/scanner.cpp --- atscepg-0.1.0.org/scanner.cpp 2007-12-28 00:37:34.000000000 -0500 +++ atscepg-0.1.0/scanner.cpp 2008-08-01 18:20:06.000000000 -0400 @@ -129,7 +129,7 @@ if (file) { char c = (Tid == 0xC9) ? 'C' : 'T'; - fprintf(file, "%s:%d:M8:%c:0:", name, currentFrequency, c); + fprintf(file, "%s:%d:M4:%c:0:", name, currentFrequency, c); if (ch.PCR_PID && ch.PCR_PID != ch.vPID) fprintf(file, "%d+%d:", ch.vPID, ch.PCR_PID); else diff -Naur atscepg-0.1.0.org/tables.cpp atscepg-0.1.0/tables.cpp --- atscepg-0.1.0.org/tables.cpp 2007-12-27 23:38:24.000000000 -0500 +++ atscepg-0.1.0/tables.cpp 2008-01-21 12:35:12.000000000 -0500 @@ -56,9 +56,11 @@ protocol_version = data[8]; //CRC_32 = get_u32(data+section_length-1); - + + crc_failed = 0; if ( !SI::CRC32::isValid( (const char*)data, section_length+3) ) { - dprint(L_ERR, "CRC 32 integrity check failed"); + dprint(L_ERR, "CRC 32 integrity check failed"); + crc_failed = 1; } } @@ -103,6 +105,10 @@ void MGT::parse(const u8* data) { + if (getCRCFailed()) { + return; + } + u16 tables_defined = get_u16( data+9 ); const uchar* d = data + 11; @@ -306,7 +312,7 @@ u8 service_type = (d[27] & 0x3F); */ u16 source_id = get_u16( d+28 ); - + Channel ch(transport_stream_id, source_id, short_name); ch.majorChannelNumber = major_channel_number; ch.minorChannelNumber = minor_channel_number; diff -Naur atscepg-0.1.0.org/tables.h atscepg-0.1.0/tables.h --- atscepg-0.1.0.org/tables.h 2007-12-27 23:38:14.000000000 -0500 +++ atscepg-0.1.0/tables.h 2008-01-19 17:21:00.000000000 -0500 @@ -24,6 +24,7 @@ u32 getNumDescriptors(void) { return descriptors.size(); } Descriptor* getDescriptor(u32 i); static u8 extractVersion(const u8* data) { return (data[5] >> 1) & 0x1F; } + u8 getCRCFailed() { return crc_failed; } protected: void addDescriptors(const u8* data, u16 length); @@ -42,6 +43,7 @@ u8 protocol_version; // PSIP_table_data() //u32 CRC_32; + u8 crc_failed; std::vector descriptors; }; diff -Naur atscepg-0.1.0.org/vdrInterface.cpp atscepg-0.1.0/vdrInterface.cpp --- atscepg-0.1.0.org/vdrInterface.cpp 2007-12-26 19:37:27.000000000 -0500 +++ atscepg-0.1.0/vdrInterface.cpp 2008-01-28 18:49:38.000000000 -0500 @@ -187,7 +187,7 @@ { char c = (table_id == 0xC9) ? 'C' : 'T'; int freq = cATSCFilter::Frequency(); - fprintf(stderr, "\n%s:%d:M8:%c:0:", ch.short_name.c_str(), freq, c); + fprintf(stderr, "\n%s:%d:M4:%c:0:", ch.short_name.c_str(), freq, c); if (ch.PCR_PID && ch.PCR_PID != ch.vPID) fprintf(stderr, "%d+%d:", ch.vPID, ch.PCR_PID);