Ticket #2541: 2541-v1.patch
File 2541-v1.patch, 3.8 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/tv_rec.cpp
1822 1822 * \brief This creates a SignalMonitor instance if one is needed and 1823 1823 * begins signal monitoring. 1824 1824 * 1825 * If the channel exists and the cardtype is "DVB" or "HDTV" a1826 * SignalMonitor instance is created and SignalMonitor::Start()1825 * If the channel exists and the cardtype is "DVB", "HDTV" or "HDHomeRun" 1826 * a SignalMonitor instance is created and SignalMonitor::Start() 1827 1827 * is called to start the signal monitoring thread. 1828 1828 * 1829 1829 * \param tablemon If set we enable table monitoring 1830 1830 * \param notify If set we notify the frontend of the signal values 1831 * \return true on success, false on failure 1831 1832 */ 1832 voidTVRec::SetupSignalMonitor(bool tablemon, bool notify)1833 bool TVRec::SetupSignalMonitor(bool tablemon, bool notify) 1833 1834 { 1834 1835 VERBOSE(VB_RECORD, LOC + "SetupSignalMonitor(" 1835 1836 <<tablemon<<", "<<notify<<")"); 1836 1837 1837 1838 // if it already exists, there no need to initialize it 1838 1839 if (signalMonitor) 1839 return ;1840 return true; 1840 1841 1841 1842 // if there is no channel object we can't monitor it 1842 1843 if (!channel) 1843 return ;1844 return false; 1844 1845 1845 1846 // make sure statics are initialized 1846 1847 SignalMonitorValue::Init(); … … 1852 1853 { 1853 1854 VERBOSE(VB_RECORD, LOC + "Signal monitor successfully created"); 1854 1855 // If this is a monitor for Digital TV, initialize table monitors 1855 if (GetDTVSignalMonitor() && tablemon) 1856 SetupDTVSignalMonitor(); 1856 if (GetDTVSignalMonitor() && tablemon && !SetupDTVSignalMonitor()) 1857 { 1858 VERBOSE(VB_IMPORTANT, LOC_ERR + 1859 "Failed to setup digital signal monitoring"); 1857 1860 1861 return false; 1862 } 1863 1858 1864 connect(signalMonitor, SIGNAL(AllGood(void)), 1859 1865 this, SLOT(SignalMonitorAllGood(void))); 1860 1866 … … 1864 1870 // Start the monitoring thread 1865 1871 signalMonitor->Start(); 1866 1872 } 1873 1874 return true; 1867 1875 } 1868 1876 1869 1877 /** \fn TVRec::TeardownSignalMonitor() … … 3505 3513 if (use_sm) 3506 3514 { 3507 3515 VERBOSE(VB_RECORD, LOC + "Starting Signal Monitor"); 3508 SetupSignalMonitor(!antadj, livetv | antadj); 3516 bool error = false; 3517 if (!SetupSignalMonitor(!antadj, livetv | antadj)) 3518 { 3519 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to setup signal monitor"); 3520 if (signalMonitor) 3521 { 3522 signalMonitor->deleteLater(); 3523 signalMonitor = NULL; 3524 } 3509 3525 3526 // pretend the signal monitor is running to prevent segfault 3527 SetFlags(kFlagSignalMonitorRunning); 3528 ClearFlags(kFlagWaitingForSignal); 3529 error = true; 3530 } 3531 3510 3532 if (signalMonitor) 3511 3533 { 3512 3534 if (request.flags & kFlagEITScan) … … 3533 3555 VERBOSE(VB_RECORD, "DummyDTVRecorder -- started"); 3534 3556 SetFlags(kFlagRingBufferReady); 3535 3557 } 3558 3559 // if we had problems starting the signal monitor, 3560 // we don't want to start the recorder... 3561 if (error) 3562 return; 3536 3563 } 3537 3564 3538 3565 // Request a recorder, if the command is a recording command -
libs/libmythtv/tv_rec.h
259 259 DVBChannel *GetDVBChannel(void); 260 260 Channel *GetV4LChannel(void); 261 261 262 voidSetupSignalMonitor(bool enable_table_monitoring, bool notify);262 bool SetupSignalMonitor(bool enable_table_monitoring, bool notify); 263 263 bool SetupDTVSignalMonitor(void); 264 264 void TeardownSignalMonitor(void); 265 265 DTVSignalMonitor *GetDTVSignalMonitor(void);