Ticket #2695: 2695-uk-v1.patch
| File 2695-uk-v1.patch, 10.8 KB (added by , 17 years ago) |
|---|
-
libs/libmythtv/channelscan/channelscan_sm.h
182 182 183 183 static QString loc(const ChannelScanSM*); 184 184 185 static const uint kDVBTableTimeout; 186 static const uint kATSCTableTimeout; 187 static const uint kMPEGTableTimeout; 188 185 189 private: 186 190 // Set in constructor 187 191 ScanMonitor *scan_monitor; -
libs/libmythtv/channelscan/channelimporter.cpp
45 45 46 46 ScanDTVTransportList transports = _transports; 47 47 48 // Print out each channel 49 cout << "Before processing: " << endl; 50 ChannelImporterBasicStats infoA = CollectStats(transports); 51 cout << FormatChannels(transports, infoA).toAscii().constData() << endl; 52 cout << endl << endl; 53 48 54 CleanupDuplicates(transports); 49 55 50 56 uint saved_scan = 0; … … 66 72 CollectUniquenessStats(transports, info); 67 73 68 74 // Print out each channel 75 cout << "After processing: " << endl; 69 76 cout << FormatChannels(transports, info).toAscii().constData() << endl; 70 77 71 78 // Create summary … … 745 752 .arg(chan.pat_tsid) 746 753 .arg(si_standard)).toAscii().constData(); 747 754 else if (si_standard == "dvb") 748 ssMsg << (QString("%1:%2:%3:%4:%5:%6 :%8")755 ssMsg << (QString("%1:%2:%3:%4:%5:%6=%7:%8") 749 756 .arg(chan.service_name).arg(chan.chan_num) 750 757 .arg(chan.netid).arg(chan.orig_netid) 758 .arg(chan.service_id) 751 759 .arg(chan.sdt_tsid) 752 760 .arg(chan.pat_tsid) 753 761 .arg(si_standard)).toAscii().constData(); -
libs/libmythtv/channelscan/channelscan_sm.cpp
59 59 #include "hdhrchannel.h" 60 60 #include "v4lchannel.h" 61 61 62 /// SDT's should be sent every 2 seconds and NIT's every 63 /// 10 seconds, so lets wait at least 30 seconds, in 64 /// case of bad transmitter or lost packets. 65 const uint ChannelScanSM::kDVBTableTimeout = 30 * 1000; 66 /// No logic here, lets just wait at least 10 seconds. 67 const uint ChannelScanSM::kATSCTableTimeout = 10 * 1000; 68 /// No logic here, lets just wait at least 15 seconds. 69 const uint ChannelScanSM::kMPEGTableTimeout = 15 * 1000; 70 62 71 QString ChannelScanSM::loc(const ChannelScanSM *siscan) 63 72 { 64 73 if (siscan && siscan->channel) … … 511 520 } 512 521 513 522 // DVB 514 if ((!wait_until_complete || sd->HasCachedAllNIT()) && info->nits.empty()) 523 if ((!wait_until_complete || sd->HasCachedAllNIT()) && 524 info->nits.empty()) 525 { 515 526 info->nits = sd->GetCachedNIT(); 527 VERBOSE(VB_IMPORTANT, 528 QString("HERE -- Setting info->nits size() : %1, " 529 "wait_until_complete: %2") 530 .arg(info->nits.size()) 531 .arg(wait_until_complete)); 532 } 516 533 517 534 sdt_vec_t sdttmp = sd->GetCachedSDTs(); 518 535 tsid_checked.clear(); … … 536 553 transport_tune_complete &= !info->pmts.empty(); 537 554 if (sd->HasCachedMGT() || sd->HasCachedAnyVCTs()) 538 555 { 556 transport_tune_complete &= sd->HasCachedMGT(); 539 557 transport_tune_complete &= 540 558 (!info->tvcts.empty() || !info->cvcts.empty()); 541 559 } … … 544 562 transport_tune_complete &= !info->nits.empty(); 545 563 transport_tune_complete &= !info->sdts.empty(); 546 564 } 565 if (transport_tune_complete) 566 { 567 VERBOSE(VB_CHANSCAN, 568 QString("transport_tune_complete: " 569 "\n\t\t\tinfo->pmts.empty(): %1" 570 "\n\t\t\tsd->HasCachedAnyNIT(): %2" 571 "\n\t\t\tsd->HasCachedAnySDTs(): %3" 572 "\n\t\t\tinfo->nits.empty(): %4" 573 "\n\t\t\tinfo->sdts.empty(): %5") 574 .arg(info->pmts.empty()) 575 .arg(sd->HasCachedAnyNIT()) 576 .arg(sd->HasCachedAnySDTs()) 577 .arg(info->nits.empty()) 578 .arg(info->sdts.empty())); 579 } 547 580 } 548 581 transport_tune_complete |= !wait_until_complete; 582 if (transport_tune_complete) 583 { 584 VERBOSE(VB_CHANSCAN, 585 QString("transport_tune_complete: wait_until_complete %1") 586 .arg(wait_until_complete)); 587 } 549 588 550 589 if (transport_tune_complete && 551 590 /*!ignoreEncryptedServices &&*/ currentEncryptionStatus.size()) … … 1134 1173 bool ChannelScanSM::HasTimedOut(void) 1135 1174 { 1136 1175 if (currentTestingDecryption) 1137 return (timer.elapsed() > (int)kDecryptionTimeout); 1176 { 1177 bool to = (timer.elapsed() > (int)kDecryptionTimeout); 1178 if (to) 1179 VERBOSE(VB_IMPORTANT, "HasTimedOut() decryption timeout reached"); 1180 return to; 1181 } 1138 1182 1139 1183 if (!waitingForTables) 1184 { 1185 VERBOSE(VB_IMPORTANT, "HasTimedOut() waitingForTables == false"); 1140 1186 return true; 1187 } 1141 1188 1142 1189 #ifdef USING_DVB 1143 1190 // If the rotor is still moving, reset the timer and keep waiting … … 1161 1208 1162 1209 // have the tables have timed out? 1163 1210 if (timer.elapsed() > (int)channelTimeout) 1211 { 1212 // the channelTimeout alone is only valid if we have seen no tables.. 1213 const ScanStreamData *sd = NULL; 1214 if (GetDTVSignalMonitor()) 1215 sd = GetDTVSignalMonitor()->GetScanStreamData(); 1216 1217 if (!sd) 1218 { 1219 VERBOSE(VB_IMPORTANT, 1220 "HasTimedOut() !ssd && channel timeout reached"); 1221 return true; 1222 } 1223 1224 if (sd->HasCachedAnyNIT() || sd->HasCachedAnySDTs()) 1225 { 1226 if (timer.elapsed() > (int) kDVBTableTimeout) 1227 { 1228 VERBOSE(VB_IMPORTANT, 1229 "HasTimedOut() DVB && DVB table timeout reached"); 1230 return true; 1231 } 1232 else 1233 return false; 1234 } 1235 if (sd->HasCachedMGT() || sd->HasCachedAnyVCTs()) 1236 { 1237 if (timer.elapsed() > (int) kATSCTableTimeout) 1238 { 1239 VERBOSE(VB_IMPORTANT, 1240 "HasTimedOut() ATSC && ATSC table timeout reached"); 1241 return true; 1242 } 1243 else 1244 return false; 1245 } 1246 if (sd->HasCachedAnyPAT() || sd->HasCachedAnyPMTs()) 1247 { 1248 if (timer.elapsed() > (int) kMPEGTableTimeout) 1249 { 1250 VERBOSE(VB_IMPORTANT, 1251 "HasTimedOut() MPEG && MPEG table timeout reached"); 1252 return true; 1253 } 1254 else 1255 return false; 1256 } 1257 1258 VERBOSE(VB_IMPORTANT, 1259 "HasTimedOut() !tables && channel timeout reached"); 1164 1260 return true; 1261 } 1165 1262 1166 1263 // ok the tables haven't timed out, but have we hit the signal timeout? 1167 1264 SignalMonitor *sm = GetSignalMonitor(); 1168 1265 if ((timer.elapsed() > (int)(*current).timeoutTune) && 1169 1266 sm && !sm->HasSignalLock()) 1170 1267 { 1171 return true; 1268 const ScanStreamData *sd = NULL; 1269 if (GetDTVSignalMonitor()) 1270 sd = GetDTVSignalMonitor()->GetScanStreamData(); 1271 1272 if (!sd) 1273 { 1274 VERBOSE(VB_IMPORTANT, 1275 "HasTimedOut() signal timeout reached && !ssd"); 1276 return true; 1277 } 1278 1279 // Just is case we temporarily lose the signal after we've seen 1280 // tables... 1281 if (!sd->HasCachedAnyPAT() && !sd->HasCachedAnyPMTs() && 1282 !sd->HasCachedMGT() && !sd->HasCachedAnyVCTs() && 1283 !sd->HasCachedAnyNIT() && !sd->HasCachedAnySDTs()) 1284 { 1285 VERBOSE(VB_IMPORTANT, 1286 "HasTimedOut() signal timeout reached && !tables"); 1287 return true; 1288 } 1172 1289 } 1173 1290 1174 1291 return false; -
libs/libmythtv/mpeg/mpegstreamdata.cpp
1263 1263 return true; 1264 1264 } 1265 1265 1266 bool MPEGStreamData::HasCachedAnyPMTs(void) const 1267 { 1268 QMutexLocker locker(&_cache_lock); 1269 return _cached_pmts.size(); 1270 } 1271 1266 1272 const pat_ptr_t MPEGStreamData::GetCachedPAT( 1267 1273 uint tsid, uint section_num) const 1268 1274 { -
libs/libmythtv/mpeg/atscstreamdata.cpp
617 617 if (!current) 618 618 VERBOSE(VB_IMPORTANT, "Currently we ignore \'current\' param"); 619 619 620 QMutexLocker locker(&_cache_lock); 621 return !_cached_tvcts.empty(); 622 #if 0 620 623 if (!_cached_mgt) 621 624 return false; 622 625 … … 630 633 _cache_lock.unlock(); 631 634 632 635 return ret; 636 #endif 633 637 } 634 638 635 639 bool ATSCStreamData::HasCachedAnyCVCTs(bool current) const … … 637 641 if (!current) 638 642 VERBOSE(VB_IMPORTANT, "Currently we ignore \'current\' param"); 639 643 644 QMutexLocker locker(&_cache_lock); 645 return !_cached_cvcts.empty(); 646 #if 0 640 647 if (!_cached_mgt) 641 648 return false; 642 649 … … 650 657 _cache_lock.unlock(); 651 658 652 659 return ret; 660 #endif 653 661 } 654 662 655 663 const MasterGuideTable *ATSCStreamData::GetCachedMGT(bool current) const -
libs/libmythtv/mpeg/dvbstreamdata.cpp
738 738 bool DVBStreamData::HasCachedAnySDTs(bool current) const 739 739 { 740 740 QMutexLocker locker(&_cache_lock); 741 741 return !_cached_sdts.empty(); 742 #if 0 742 743 if (_cached_nit.empty()) 743 744 return false; 744 745 … … 753 754 } 754 755 755 756 return false; 757 #endif 756 758 } 757 759 758 760 bool DVBStreamData::HasCachedAllSDTs(bool current) const -
libs/libmythtv/mpeg/mpegstreamdata.h
198 198 bool HasCachedAllPMT(uint program_num) const; 199 199 bool HasCachedAnyPMT(uint program_num) const; 200 200 bool HasCachedAllPMTs(void) const; 201 bool HasCachedAnyPMTs(void) const; 201 202 202 203 const pat_ptr_t GetCachedPAT(uint tsid, uint section_num) const; 203 204 pat_vec_t GetCachedPATs(uint tsid) const;
