Ticket #2099: remove-norecover-retunes.patch
File remove-norecover-retunes.patch, 2.9 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/dvbchannel.cpp
601 601 return false; 602 602 } 603 603 604 tune_time.start();605 604 desired_tuning = tuning; 606 605 607 606 if (fd_frontend < 0) … … 784 783 return NULL; 785 784 } 786 785 787 bool DVBChannel::IsSelfRetuning(void) const788 {789 return info.caps & FE_CAN_RECOVER;790 }791 792 int DVBChannel::GetTimeSinceTune(void) const793 {794 return first_tune ? 0 : tune_time.elapsed();795 }796 797 786 /** \fn drain_dvb_events(int) 798 787 * \brief Reads all the events off the queue, so we can use select 799 788 * in wait_for_backend(int,int). -
libs/libmythtv/dvbchannel.h
59 59 /// Returns true iff we have a faulty DVB driver that munges PMT 60 60 bool HasCRCBug(void) const { return has_crc_bug; } 61 61 uint GetMinSignalMonitorDelay(void) const { return sigmon_delay; } 62 /// If true the hardware will retune when it loses lock, otherwise63 /// the tuner needs to be told to tune when it loses lock.64 bool IsSelfRetuning(void) const;65 /// Milliseconds since last tuning request, or 0 if never tuned.66 int GetTimeSinceTune(void) const;67 62 /// Returns rotor object if it exists, NULL otherwise. 68 63 const DiSEqCDevRotor *GetRotor(void) const; 69 64 … … 121 116 int cardnum; ///< DVB Card number 122 117 bool has_crc_bug; ///< true iff our driver munges PMT 123 118 int nextInputID; ///< Signal an input change 124 QTime tune_time; ///< FIXME won't work well at midnight125 119 }; 126 120 127 121 #endif -
libs/libmythtv/dvbsignalmonitor.cpp
503 503 void DVBSignalMonitor::RetuneMonitor(void) 504 504 { 505 505 DVBChannel *dvbchan = dynamic_cast<DVBChannel*>(channel); 506 int fd_frontend = dvbchan->GetFd();507 506 508 // Get lock status509 bool is_locked = true;510 fe_status_t status;511 if (ioctl(fd_frontend, FE_READ_STATUS, &status) != -1)512 {513 QMutexLocker locker(&statusLock);514 is_locked = (status & FE_HAS_LOCK);515 signalLock.SetValue(is_locked ? 1 : 0);516 }517 518 507 // Rotor position 519 508 if (HasFlags(kDVBSigMon_WaitForPos)) 520 509 { … … 547 536 rotorPosition.SetValue(100); 548 537 } 549 538 } 550 551 // Periodically retune if card can't recover552 if (!dvbchan->IsSelfRetuning() && !is_locked &&553 dvbchan->GetTimeSinceTune() > RETUNE_TIMEOUT)554 {555 DBG_SM("UpdateValues", "Retuning for lock loss");556 dvbchan->Retune();557 }558 539 } 559 540 560 541 void DVBSignalMonitor::RunTableMonitor(void)