From: Lars Op den Kamp Date: Thu, 10 Nov 2011 17:30:00 +0000 (+0100) Subject: cec: only set the power status to 'on' for the primary device X-Git-Tag: upstream/2.2.0~1^2~85 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f2cb2c465000f62dfa907a8384dbb1add89d56be;p=deb_libcec.git cec: only set the power status to 'on' for the primary device --- diff --git a/include/cectypes.h b/include/cectypes.h index 8c6cf9c..7778339 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -196,6 +196,8 @@ typedef struct cec_device_type_list } return bReturn; } + + cec_device_type operator[](uint8_t pos) const { return pos < 5 ? types[pos] : CEC_DEVICE_TYPE_RESERVED; } #endif } cec_device_type_list; diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index f4a6da0..9c368a8 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -151,7 +151,7 @@ bool CCECProcessor::TryLogicalAddress(cec_logical_address address, const char *s /* only set our OSD name for the primary device */ if (m_logicalAddresses.empty()) m_busDevices[address]->m_strDeviceName = m_strDeviceName; - m_busDevices[address]->m_powerStatus = CEC_POWER_STATUS_ON; + m_busDevices[address]->m_powerStatus = (m_types[0] == m_busDevices[address]->m_type) ? CEC_POWER_STATUS_ON : CEC_POWER_STATUS_STANDBY; m_busDevices[address]->m_cecVersion = CEC_VERSION_1_3A; m_logicalAddresses.set(address);