cec: don't send 'image view on' to LG unless needed, or the tv will get caught in...
[deb_libcec.git] / src / lib / devices / CECBusDevice.cpp
index 0fc486f220fd9244ef14c5672bb1fcf8f166e111..87954228bda9fe6e514b75628f55697a53612731 100644 (file)
@@ -683,7 +683,7 @@ bool CCECBusDevice::TransmitActiveSource(void)
 
   {
     CLockObject lock(m_mutex);
-    if (m_powerStatus != CEC_POWER_STATUS_ON)
+    if (m_powerStatus != CEC_POWER_STATUS_ON && m_powerStatus != CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON)
       CLibCEC::AddLog(CEC_LOG_DEBUG, "<< %s (%X) is not powered on", GetLogicalAddressName(), m_iLogicalAddress);
     else if (m_bActiveSource)
     {
@@ -697,7 +697,6 @@ bool CCECBusDevice::TransmitActiveSource(void)
   if (bSendActiveSource)
   {
     MarkBusy();
-    m_handler->TransmitImageViewOn(m_iLogicalAddress, CECDEVICE_TV);
     m_handler->TransmitActiveSource(m_iLogicalAddress, m_iPhysicalAddress);
     MarkReady();
     return true;
@@ -721,6 +720,23 @@ bool CCECBusDevice::TransmitCECVersion(cec_logical_address dest)
   return bReturn;
 }
 
+bool CCECBusDevice::TransmitImageViewOn(void)
+{
+  CLockObject lock(m_mutex);
+  if (m_powerStatus != CEC_POWER_STATUS_ON && m_powerStatus != CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON)
+  {
+    CLibCEC::AddLog(CEC_LOG_DEBUG, "<< %s (%X) is not powered on", GetLogicalAddressName(), m_iLogicalAddress);
+    return false;
+  }
+  else
+  {
+    MarkBusy();
+    m_handler->TransmitImageViewOn(m_iLogicalAddress, CECDEVICE_TV);
+    MarkReady();
+    return true;
+  }
+}
+
 bool CCECBusDevice::TransmitInactiveSource(void)
 {
   uint16_t iPhysicalAddress;