cec: fixed SetActiveView(). the correct hdmi port will now be selected again
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 33fda207195284fd12be2178daf39baab0eed683..a51abc7917b2fdc48fa4b789e6277027f1f33d1d 100644 (file)
@@ -56,7 +56,7 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, CAdapterCommunication *serComm
 {
   m_logicalAddresses.Clear();
   m_logicalAddresses.Set(iLogicalAddress);
-  m_types.Clear();
+  m_types.clear();
   for (int iPtr = 0; iPtr <= 16; iPtr++)
     m_busDevices[iPtr] = new CCECBusDevice(this, (cec_logical_address) iPtr, iPtr == iLogicalAddress ? iPhysicalAddress : 0);
 }
@@ -312,12 +312,13 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
     }
   }
 
-  return SetStreamPath(m_busDevices[addr]->GetPhysicalAddress());
+  return SetStreamPath(m_busDevices[addr]->GetPhysicalAddress()) &&
+      m_busDevices[addr]->TransmitActiveSource();
 }
 
 bool CCECProcessor::SetActiveView(void)
 {
-  return SetActiveSource();
+  return SetActiveSource(m_types.IsEmpty() ? CEC_DEVICE_TYPE_RESERVED : m_types[0]);
 }
 
 bool CCECProcessor::SetDeckControlMode(cec_deck_control_mode mode, bool bSendUpdate /* = true */)