cec: fix the initial hdmi port setting
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 00b25a26240062035a6f53284c6301d144c36b3b..bf23d94b6863bef1337765c34f174823b25970df 100644 (file)
@@ -211,10 +211,10 @@ bool CCECProcessor::Initialise(void)
 
   /* get the vendor id from the TV, so we are using the correct handler */
   m_busDevices[CECDEVICE_TV]->RequestVendorId();
-  ReplaceHandlers();
 
   if (m_iPhysicalAddress != 0)
   {
+    CLibCEC::AddLog(CEC_LOG_NOTICE, "setting the physical address to %4x", m_iPhysicalAddress);
     m_busDevices[m_logicalAddresses.primary]->m_iPhysicalAddress = m_iPhysicalAddress;
     if ((bReturn = m_busDevices[m_logicalAddresses.primary]->TransmitPhysicalAddress()) == false)
       CLibCEC::AddLog(CEC_LOG_ERROR, "unable to set the physical address to %4x", m_iPhysicalAddress);
@@ -406,7 +406,6 @@ bool CCECProcessor::FindLogicalAddresses(void)
 
 void CCECProcessor::ReplaceHandlers(void)
 {
-  CLockObject lock(m_mutex);
   if (!IsInitialised())
     return;
   for (uint8_t iPtr = 0; iPtr <= CECDEVICE_PLAYBACKDEVICE3; iPtr++)
@@ -461,7 +460,8 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
   m_busDevices[addr]->SetActiveSource();
   if (m_busDevices[addr]->GetPhysicalAddress(false) != 0xFFFF)
   {
-    bReturn = m_busDevices[addr]->TransmitActiveSource();
+    bReturn = m_busDevices[addr]->TransmitImageViewOn() &&
+        m_busDevices[addr]->TransmitActiveSource();
 
     if (bReturn)
     {