Ticket #3640: dvb_broken_nit_providers1.diff
File dvb_broken_nit_providers1.diff, 3.2 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/mpeg/dvbtables.cpp
77 77 return _cached_network_name; 78 78 } 79 79 80 bool NetworkInformationTable::Mutate(void) 81 { 82 if (VerifyCRC()) 83 { 84 SetTableID((TableID() == TableID::NITo) ? TableID::NIT : TableID::NITo); 85 SetCRC(CalcCRC()); 86 return true; 87 } 88 else 89 return false; 90 } 80 91 81 92 void ServiceDescriptionTable::Parse(void) const 82 93 { -
libs/libmythtv/mpeg/dvbstreamdata.cpp
10 10 11 11 #define PREMIERE_ONID 133 12 12 13 /* change to the "correct" network ID for broken dvb providers 14 * which transmit the real NIT as NIT other 15 */ 16 static const int real_network_id = -1; 17 13 18 // service_id is synonymous with the MPEG program number in the PMT. 14 19 DVBStreamData::DVBStreamData(uint desired_netid, uint desired_tsid, 15 20 int desired_program, bool cacheTables) … … 220 225 { 221 226 case TableID::NIT: 222 227 { 228 if (real_network_id >= 0 && psip.TableIDExtension() != (uint)real_network_id) 229 { 230 NetworkInformationTable *nit = new NetworkInformationTable(psip); 231 if (!nit->Mutate()) 232 { 233 delete nit; 234 return true; 235 } 236 bool retval = HandleTables(pid, *nit); 237 delete nit; 238 return retval; 239 } 240 223 241 SetVersionNIT(psip.Version(), psip.LastSection()); 224 242 SetNITSectionSeen(psip.Section()); 225 243 … … 277 295 } 278 296 case TableID::NITo: 279 297 { 298 if (real_network_id >= 0 && psip.TableIDExtension() == (uint)real_network_id) 299 { 300 NetworkInformationTable *nit = new NetworkInformationTable(psip); 301 if (!nit->Mutate()) 302 { 303 delete nit; 304 return true; 305 } 306 bool retval = HandleTables(pid, *nit); 307 delete nit; 308 return retval; 309 } 310 280 311 SetVersionNITo(psip.Version(), psip.LastSection()); 281 312 SetNIToSectionSeen(psip.Section()); 282 313 NetworkInformationTable nit(psip); -
libs/libmythtv/mpeg/dvbtables.h
79 79 { return _ptrs[i]+6; } 80 80 // } 81 81 82 /// mutates a NITo into a NITa (vice versa) and recalculates the CRC 83 bool Mutate(void); 84 82 85 void Parse(void) const; 83 86 QString toString(void) const; 84 87 QString NetworkName(void) const; … … 154 157 // } 155 158 ServiceDescriptor *GetServiceDescriptor(uint i) const; 156 159 157 /// mutates a SDTo into a SDTa and recalculates the CRC160 /// mutates a SDTo into a SDTa (vice versa) and recalculates the CRC 158 161 bool Mutate(void); 159 162 160 163 void Parse(void) const;