@@ -236,6 +236,8 @@ void ChannelScanSM::SetAnalog(bool is_analog)
236236
237237void ChannelScanSM::HandleAllGood (void )
238238{
239+ QMutexLocker locker (&lock);
240+
239241 QString cur_chan = (*current).FriendlyName ;
240242 QStringList list = cur_chan.split (" " , QString::SkipEmptyParts);
241243 QString freqid = (list.size () >= 2 ) ? list[1 ] : cur_chan;
@@ -341,6 +343,8 @@ bool ChannelScanSM::ScanExistingTransports(uint sourceid, bool follow_nit)
341343
342344void ChannelScanSM::HandlePAT (const ProgramAssociationTable *pat)
343345{
346+ QMutexLocker locker (&lock);
347+
344348 LOG (VB_CHANSCAN, LOG_INFO, LOC +
345349 QString (" Got a Program Association Table for %1" )
346350 .arg ((*current).FriendlyName ) + " \n " + pat->toString ());
@@ -356,6 +360,8 @@ void ChannelScanSM::HandlePAT(const ProgramAssociationTable *pat)
356360
357361void ChannelScanSM::HandlePMT (uint, const ProgramMapTable *pmt)
358362{
363+ QMutexLocker locker (&lock);
364+
359365 LOG (VB_CHANSCAN, LOG_INFO, LOC + QString (" Got a Program Map Table for %1" )
360366 .arg ((*current).FriendlyName ) + " \n " + pmt->toString ());
361367
@@ -365,6 +371,8 @@ void ChannelScanSM::HandlePMT(uint, const ProgramMapTable *pmt)
365371
366372void ChannelScanSM::HandleVCT (uint, const VirtualChannelTable *vct)
367373{
374+ QMutexLocker locker (&lock);
375+
368376 LOG (VB_CHANSCAN, LOG_INFO, LOC +
369377 QString (" Got a Virtual Channel Table for %1" )
370378 .arg ((*current).FriendlyName ) + " \n " + vct->toString ());
@@ -382,6 +390,8 @@ void ChannelScanSM::HandleVCT(uint, const VirtualChannelTable *vct)
382390
383391void ChannelScanSM::HandleMGT (const MasterGuideTable *mgt)
384392{
393+ QMutexLocker locker (&lock);
394+
385395 LOG (VB_CHANSCAN, LOG_INFO, LOC + QString (" Got the Master Guide for %1" )
386396 .arg ((*current).FriendlyName ) + " \n " + mgt->toString ());
387397
@@ -390,6 +400,8 @@ void ChannelScanSM::HandleMGT(const MasterGuideTable *mgt)
390400
391401void ChannelScanSM::HandleSDT (uint tsid, const ServiceDescriptionTable *sdt)
392402{
403+ QMutexLocker locker (&lock);
404+
393405 LOG (VB_CHANSCAN, LOG_INFO, LOC +
394406 QString (" Got a Service Description Table for %1" )
395407 .arg ((*current).FriendlyName ) + " \n " + sdt->toString ());
@@ -433,6 +445,8 @@ void ChannelScanSM::HandleSDT(uint tsid, const ServiceDescriptionTable *sdt)
433445
434446void ChannelScanSM::HandleNIT (const NetworkInformationTable *nit)
435447{
448+ QMutexLocker locker (&lock);
449+
436450 LOG (VB_CHANSCAN, LOG_INFO, LOC +
437451 QString (" Got a Network Information Table for %1" )
438452 .arg ((*current).FriendlyName ) + " \n " + nit->toString ());
@@ -442,6 +456,8 @@ void ChannelScanSM::HandleNIT(const NetworkInformationTable *nit)
442456
443457void ChannelScanSM::HandleBAT (const BouquetAssociationTable *bat)
444458{
459+ QMutexLocker locker (&lock);
460+
445461 LOG (VB_CHANSCAN, LOG_INFO, LOC + " Got a Bouquet Association Table\n " +
446462 bat->toString ());
447463
@@ -483,6 +499,8 @@ void ChannelScanSM::HandleBAT(const BouquetAssociationTable *bat)
483499
484500void ChannelScanSM::HandleSDTo (uint tsid, const ServiceDescriptionTable *sdt)
485501{
502+ QMutexLocker locker (&lock);
503+
486504 LOG (VB_CHANSCAN, LOG_INFO, LOC +
487505 " Got a Service Description Table (other)\n " + sdt->toString ());
488506
@@ -513,6 +531,8 @@ void ChannelScanSM::HandleSDTo(uint tsid, const ServiceDescriptionTable *sdt)
513531
514532void ChannelScanSM::HandleEncryptionStatus (uint pnum, bool encrypted)
515533{
534+ QMutexLocker locker (&lock);
535+
516536 currentEncryptionStatus[pnum] = encrypted ? kEncEncrypted : kEncDecrypted ;
517537
518538 if (kEncDecrypted == currentEncryptionStatus[pnum])
@@ -1534,6 +1554,8 @@ bool ChannelScanSM::HasTimedOut(void)
15341554 */
15351555void ChannelScanSM::HandleActiveScan (void )
15361556{
1557+ QMutexLocker locker (&lock);
1558+
15371559 bool do_post_insertion = waitingForTables;
15381560
15391561 if (!HasTimedOut ())
@@ -1576,7 +1598,8 @@ void ChannelScanSM::HandleActiveScan(void)
15761598 QString name = QString (" TransportID %1" ).arg (it.key () & 0xffff );
15771599 TransportScanItem item (sourceID, name, *it, signalTimeout);
15781600 LOG (VB_CHANSCAN, LOG_INFO, LOC + " Adding " + name + " - " +
1579- item.tuning .toString ());
1601+ item.
1602+ tuning.toString ());
15801603 scanTransports.push_back (item);
15811604 ts_scanned.insert (it.key ());
15821605 }
0 commit comments