From: Lars Op den Kamp Date: Thu, 10 Nov 2011 17:30:00 +0000 (+0100) Subject: cec: only send 'active source' when powered on X-Git-Tag: upstream/2.2.0~1^2~67 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=58c1f6f50ae4a5483e43fc9ec80233508adfe099;p=deb_libcec.git cec: only send 'active source' when powered on --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 1ca2dfe..3b66cd5 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -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(); diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 00a6bcd..5123ef0 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -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);