Ticket #8744: add_mutex_to_ChannelScannerSM.patch
File add_mutex_to_ChannelScannerSM.patch, 3.6 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/channelscan/channelscan_sm.h
236 236 QMap<uint, bool> currentEncryptionStatusChecked; 237 237 QMap<uint64_t, QString> defAuthorities; 238 238 239 /// Protects the transport lists 240 mutable QMutex transportLock; 241 239 242 /// Found Channel Info 240 243 ChannelList channelList; 241 244 uint channelsFound; -
libs/libmythtv/channelscan/channelscan_sm.cpp
355 355 356 356 void ChannelScanSM::HandlePMT(uint, const ProgramMapTable *pmt) 357 357 { 358 QMutexLocker locker(&transportLock); 359 358 360 VERBOSE(VB_CHANSCAN, LOC + 359 361 QString("Got a Program Map Table for %1") 360 362 .arg((*current).FriendlyName) + "\n" + pmt->toString()); … … 365 367 366 368 void ChannelScanSM::HandleVCT(uint, const VirtualChannelTable *vct) 367 369 { 370 QMutexLocker locker(&transportLock); 371 368 372 VERBOSE(VB_CHANSCAN, LOC + QString("Got a Virtual Channel Table for %1") 369 373 .arg((*current).FriendlyName) + "\n" + vct->toString()); 370 374 … … 381 385 382 386 void ChannelScanSM::HandleMGT(const MasterGuideTable *mgt) 383 387 { 388 QMutexLocker locker(&transportLock); 389 384 390 VERBOSE(VB_CHANSCAN, LOC + QString("Got the Master Guide for %1") 385 391 .arg((*current).FriendlyName) + "\n" + mgt->toString()); 386 392 … … 412 418 GetDTVSignalMonitor()->GetDVBStreamData()->SetVersionSDT(sdt->TSID(), -1, 0); 413 419 } 414 420 421 QMutexLocker locker(&transportLock); 422 415 423 uint id = sdt->OriginalNetworkID() << 16 | sdt->TSID(); 416 424 ts_scanned.insert(id); 417 425 … … 428 436 429 437 void ChannelScanSM::HandleNIT(const NetworkInformationTable *nit) 430 438 { 439 QMutexLocker locker(&transportLock); 440 431 441 VERBOSE(VB_CHANSCAN, LOC + 432 442 QString("Got a Network Information Table for %1") 433 443 .arg((*current).FriendlyName) + "\n" + nit->toString()); … … 460 470 DefaultAuthorityDescriptor authority(def_auth); 461 471 ServiceListDescriptor services(serv_list); 462 472 473 QMutexLocker locker(&transportLock); 474 463 475 for (uint j = 0; j < services.ServiceCount(); j++) 464 476 { 465 477 // If the default authority is given in the SDT this … … 496 508 MPEGDescriptor::Find(parsed, DescriptorID::default_authority); 497 509 if (def_auth) 498 510 { 511 QMutexLocker locker(&transportLock); 512 499 513 DefaultAuthorityDescriptor authority(def_auth); 500 514 VERBOSE(VB_CHANSCAN, LOC + QString("found default authority(SDTo) " 501 515 "for service %1 %2 %3") … … 1511 1525 1512 1526 if (0 == nextIt.offset() && nextIt != scanTransports.begin()) 1513 1527 { 1514 // Add channel to scanned list and potentially check decryption 1515 if (do_post_insertion && !UpdateChannelInfo(false)) 1516 return; 1528 { 1529 QMutexLocker locker(&transportLock); 1530 // Add channel to scanned list and potentially check decryption 1531 if (do_post_insertion && !UpdateChannelInfo(false)) 1532 return; 1533 } 1517 1534 1518 1535 // Stop signal monitor for previous transport 1519 1536 signalMonitor->Stop(); … … 1527 1544 1528 1545 current = nextIt; // Increment current 1529 1546 1547 QMutexLocker locker(&transportLock); 1548 1530 1549 if (current != scanTransports.end()) 1531 1550 { 1532 1551 ScanTransport(current);