cec: set the proper ackmask before doing anything else. set the LG vendor ID after...
authorLars Op den Kamp <lars@opdenkamp.eu>
Wed, 7 Dec 2011 22:32:48 +0000 (23:32 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Wed, 7 Dec 2011 22:32:48 +0000 (23:32 +0100)
src/lib/CECProcessor.cpp
src/lib/implementations/SLCommandHandler.cpp

index b07f2ddc72bbfcc6c61d85c440b814bc4707ca20..94651fcb45d5c00de77b8323efaca191eb1d38c4 100644 (file)
@@ -152,8 +152,10 @@ bool CCECProcessor::Start(const char *strPort, uint16_t iBaudRate /* = 38400 */,
     }
 
     lock.Leave();
-    if (SetAckMask(m_logicalAddresses.AckMask()) &&
-        SetHDMIPort(m_iBaseDevice, m_iHDMIPort, true))
+
+    m_busDevices[CECDEVICE_TV]->GetVendorId();
+
+    if (SetHDMIPort(m_iBaseDevice, m_iHDMIPort, true))
     {
       m_controller->AddLog(CEC_LOG_DEBUG, "processor thread started");
       m_busScan = new CCECBusScan(this);
@@ -260,8 +262,7 @@ void *CCECProcessor::Process(void)
   }
   else
   {
-    m_busDevices[CECDEVICE_TV]->GetVendorId();
-    m_busDevices[m_logicalAddresses.primary]->TransmitVendorID(CECDEVICE_TV, false);
+    SetAckMask(m_logicalAddresses.AckMask());
 
     CLockObject lock(&m_mutex);
     m_bStarted = true;
@@ -395,15 +396,15 @@ bool CCECProcessor::SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort,
 {
   bool bReturn(false);
 
-  CStdString strLog;
-  strLog.Format("setting HDMI port to %d on device %s (%d)", iPort, ToString(iBaseDevice), (int)iBaseDevice);
-  AddLog(CEC_LOG_DEBUG, strLog);
-
   m_iBaseDevice = iBaseDevice;
   m_iHDMIPort = iPort;
   if (!m_bStarted && !bForce)
     return true;
 
+  CStdString strLog;
+  strLog.Format("setting HDMI port to %d on device %s (%d)", iPort, ToString(iBaseDevice), (int)iBaseDevice);
+  AddLog(CEC_LOG_DEBUG, strLog);
+
   uint16_t iPhysicalAddress(0);
   iPhysicalAddress = m_busDevices[iBaseDevice]->GetPhysicalAddress();
   uint16_t iPos = 0;
index 713eebbde364432419673e8ba6593c987d6ceaf0..809558be4d814bc71ebfde6fa331ef8c1b5a7531 100644 (file)
@@ -256,7 +256,10 @@ bool CSLCommandHandler::InitHandler(void)
 
   CCECBusDevice *primary = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
   if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
+  {
     primary->SetVendorId(CEC_VENDOR_LG, false);
+    primary->TransmitVendorID(CECDEVICE_TV, false);
+  }
 
   if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
   {