cec: only send 'active source' when powered on
authorLars Op den Kamp <lars@opdenkamp.eu>
Thu, 10 Nov 2011 17:30:00 +0000 (18:30 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Thu, 10 Nov 2011 18:00:45 +0000 (19:00 +0100)
src/lib/CECProcessor.cpp
src/lib/devices/CECBusDevice.cpp

index 1ca2dfe7fc180dead8827b525ef6379e23e3b569..3b66cd551c80bea9166e14ec7997e8e87f82387b 100644 (file)
@@ -330,6 +330,7 @@ bool CCECProcessor::SetStreamPath(uint16_t iStreamPath)
       m_busDevices[iPtr]->m_bActiveSource = false;
 
     device->m_bActiveSource = true;
+    device->m_powerStatus   = CEC_POWER_STATUS_ON;
 
     if (m_logicalAddresses.isset(device->m_iLogicalAddress))
       bReturn = device->TransmitActiveSource();
index 00a6bcdb95e8ed150811378de45eea1d426a2ef2..5123ef0e8ad128ea51d76ffdd3e9df978b8ab0e9 100644 (file)
@@ -368,7 +368,13 @@ void CCECBusDevice::SetVendorId(uint64_t iVendorId, uint8_t iVendorClass /* = 0
 //@{
 bool CCECBusDevice::TransmitActiveSource(void)
 {
-  if (m_bActiveSource)
+  if (m_powerStatus != CEC_POWER_STATUS_ON)
+  {
+    CStdString strLog;
+    strLog.Format("<< %s (%X) is not powered on", GetLogicalAddressName(), m_iLogicalAddress);
+    AddLog(CEC_LOG_DEBUG, strLog);
+  }
+  else if (m_bActiveSource)
   {
     CStdString strLog;
     strLog.Format("<< %s (%X) -> broadcast (F): active source (%4x)", GetLogicalAddressName(), m_iLogicalAddress, m_iPhysicalAddress);