removed double check in cec-config
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 20 Sep 2012 15:23:55 +0000 (17:23 +0200)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 20 Sep 2012 15:26:21 +0000 (17:26 +0200)
src/cec-config/cec-config.cpp

index 1f58ccbd4234c77b1c1cd3e330f70760104d9ac8..29bdf593c58fc200a2bfdb67a07c077179d1bceb 100644 (file)
@@ -294,20 +294,17 @@ bool PowerOnTV(uint64_t iTimeout = 60000)
   uint64_t iNow = GetTimeMs();
   uint64_t iTarget = iNow + iTimeout;
 
+  currentTvPower = g_parser->GetDevicePowerStatus(CECDEVICE_TV);
   if (currentTvPower != CEC_POWER_STATUS_ON)
   {
-    currentTvPower = g_parser->GetDevicePowerStatus(CECDEVICE_TV);
-    if (currentTvPower != CEC_POWER_STATUS_ON)
+    PrintToStdOut("Sending 'power on' command to the TV\n=== Please wait ===");
+    g_parser->PowerOnDevices(CECDEVICE_TV);
+    while (iTarget > iNow)
     {
-      PrintToStdOut("Sending 'power on' command to the TV\n=== Please wait ===");
-      g_parser->PowerOnDevices(CECDEVICE_TV);
-      while (iTarget > iNow)
-      {
-        g_responseEvent.Wait((uint32_t)(iTarget - iNow));
-        if (g_lastCommand == CEC_OPCODE_REQUEST_ACTIVE_SOURCE)
-          break;
-        iNow = GetTimeMs();
-      }
+      g_responseEvent.Wait((uint32_t)(iTarget - iNow));
+      if (g_lastCommand == CEC_OPCODE_REQUEST_ACTIVE_SOURCE)
+        break;
+      iNow = GetTimeMs();
     }
   }