bReturn = SetHDMIPort(m_iBaseDevice, m_iHDMIPort, true);
}
- /* make the primary device the active source */
if (bReturn)
{
m_bInitialised = true;
- m_busDevices[m_logicalAddresses.primary]->m_bActiveSource = true;
- bReturn = m_busDevices[CECDEVICE_TV]->ActivateSource();
- }
-
- if (bReturn)
- {
m_controller->AddLog(CEC_LOG_DEBUG, "processor thread started");
}
else
bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress)
{
+ bool bWasActiveSource(false);
CLockObject lock(&m_mutex);
if (!m_logicalAddresses.IsEmpty())
{
for (uint8_t iPtr = 0; iPtr < 15; iPtr++)
if (m_logicalAddresses[iPtr])
{
+ bWasActiveSource |= m_busDevices[iPtr]->IsActiveSource();
m_busDevices[iPtr]->SetInactiveSource();
m_busDevices[iPtr]->SetPhysicalAddress(iPhysicalAddress);
m_busDevices[iPtr]->TransmitPhysicalAddress();
}
- return SetActiveView();
+
+ return bWasActiveSource ? SetActiveView() : true;
}
return false;
}
void CCECBusDevice::SetActiveSource(void)
{
CLockObject lock(&m_mutex);
+ if (!m_bActiveSource)
+ {
+ CStdString strLog;
+ strLog.Format("making %s (%x) the active source", GetLogicalAddressName(), m_iLogicalAddress);
+ AddLog(CEC_LOG_DEBUG, strLog);
+ }
for (int iPtr = 0; iPtr < 16; iPtr++)
if (iPtr != m_iLogicalAddress)
m_handler->SetVendorId(m_vendor);
m_handler->InitHandler();
- if (bActivateSource && m_processor->GetLogicalAddresses().IsSet(m_iLogicalAddress) && m_processor->IsInitialised())
+ if (bActivateSource && m_processor->GetLogicalAddresses().IsSet(m_iLogicalAddress) && m_processor->IsInitialised() && IsActiveSource())
m_handler->ActivateSource();
}
}
CANCommandHandler::CANCommandHandler(CCECBusDevice *busDevice) :
CCECCommandHandler(busDevice)
{
+ m_vendorId = CEC_VENDOR_SAMSUNG;
}
bool CANCommandHandler::HandleVendorRemoteButtonDown(const cec_command &command)