From f2cb2c465000f62dfa907a8384dbb1add89d56be Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 10 Nov 2011 18:30:00 +0100 Subject: [PATCH] cec: only set the power status to 'on' for the primary device --- include/cectypes.h | 2 ++ src/lib/CECProcessor.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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); -- 2.34.1