using namespace PLATFORM;
#define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000
-#define ACTIVE_SOURCE_CHECK_TIMEOUT 10000
+#define ACTIVE_SOURCE_CHECK_TIMEOUT 15000
#define ToString(x) CCECTypeUtils::ToString(x)
LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) is not the active source", GetLogicalAddressName(), m_iLogicalAddress);
}
+ bool bActiveSourceSent(false);
if (bSendActiveSource)
{
MarkBusy();
- m_handler->TransmitActiveSource(m_iLogicalAddress, m_iPhysicalAddress);
+ bActiveSourceSent = m_handler->TransmitActiveSource(m_iLogicalAddress, m_iPhysicalAddress);
MarkReady();
- return true;
}
- return false;
+ return bActiveSourceSent;
}
bool CCECBusDevice::TransmitImageViewOn(void)
}
}
+ bool bImageViewOnSent(false);
MarkBusy();
- m_handler->TransmitImageViewOn(m_iLogicalAddress, CECDEVICE_TV);
+ bImageViewOnSent = m_handler->TransmitImageViewOn(m_iLogicalAddress, CECDEVICE_TV);
MarkReady();
- return true;
+ return bImageViewOnSent;
}
bool CCECBusDevice::TransmitInactiveSource(void)
m_busDevice->SetPowerStatus(CEC_POWER_STATUS_ON);
m_busDevice->SetMenuState(CEC_MENU_STATE_ACTIVATED);
- if (!m_busDevice->TransmitImageViewOn() ||
- !m_busDevice->TransmitActiveSource() ||
- !m_busDevice->TransmitMenuState(CECDEVICE_TV))
+ bool bActiveSourceFailed = !m_busDevice->TransmitImageViewOn() ||
+ !m_busDevice->TransmitActiveSource() ||
+ !m_busDevice->TransmitMenuState(CECDEVICE_TV);
+
+ if (!bActiveSourceFailed)
{
+ CCECPlaybackDevice *playbackDevice = m_busDevice->AsPlaybackDevice();
+ if (playbackDevice && SendDeckStatusUpdateOnActiveSource())
+ bActiveSourceFailed = !playbackDevice->TransmitDeckStatus(CECDEVICE_TV);
+ }
+
+ if (bActiveSourceFailed)
+ {
+ LIB_CEC->AddLog(CEC_LOG_DEBUG, "failed to make '%s' the active source. will retry later", m_busDevice->GetLogicalAddressName());
CLockObject lock(m_mutex);
m_bActiveSourcePending = true;
return false;
}
- CCECPlaybackDevice *playbackDevice = m_busDevice->AsPlaybackDevice();
- if (playbackDevice && SendDeckStatusUpdateOnActiveSource())
- playbackDevice->TransmitDeckStatus(CECDEVICE_TV);
-
m_bHandlerInited = true;
}
return true;