cec: only set the power status to 'on' for the primary device
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:21 +0000 (19:00 +0100)
include/cectypes.h
src/lib/CECProcessor.cpp

index 8c6cf9c79dab4e7d428662104926a097d0b76548..7778339da99b814914c0cef2124439025d91492d 100644 (file)
@@ -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;
 
index f4a6da0a662b02de506097aa6b0f88b6deca4966..9c368a8dd0bdcba69b4ba9f3eeb9bb24ad21490b 100644 (file)
@@ -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);