fixed possible crash when the tv does not respond to polls and the client isn't regis...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 14 May 2013 23:15:22 +0000 (01:15 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 14 May 2013 23:18:32 +0000 (01:18 +0200)
src/lib/CECProcessor.cpp

index a44b81eb6a314167395916af458c7ab3d26c91f4..6749170cda71cd8310c859d54ae037e628f5a2d6 100644 (file)
@@ -245,12 +245,17 @@ void *CCECProcessor::Process(void)
       // check whether the TV is present and responding
       if (tvPresentCheck.TimeLeft() == 0)
       {
-        if (!m_busDevices->At(CECDEVICE_TV)->IsPresent())
+        CCECClient *primary = GetPrimaryClient();
+        // only check whether the tv responds to polls when a client is connected and not in monitoring mode
+        if (primary && primary->GetConfiguration()->bMonitorOnly != 1)
         {
-          libcec_parameter param;
-          param.paramType = CEC_PARAMETER_TYPE_STRING;
-          param.paramData = (void*)"TV does not respond to CEC polls";
-          GetPrimaryClient()->Alert(CEC_ALERT_TV_POLL_FAILED, param);
+          if (!m_busDevices->At(CECDEVICE_TV)->IsPresent())
+          {
+            libcec_parameter param;
+            param.paramType = CEC_PARAMETER_TYPE_STRING;
+            param.paramData = (void*)"TV does not respond to CEC polls";
+            primary->Alert(CEC_ALERT_TV_POLL_FAILED, param);
+          }
         }
         tvPresentCheck.Init(TV_PRESENT_CHECK_INTERVAL);
       }