X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=a240c9086739cc343e3e25354c5750d7acaedbfd;hb=dbad810a5713fdd10c3aece6f3bedf39c83be826;hp=77b94a49f0d27241ff27e49f760a6d477fdea4d3;hpb=42d28d15d07f893b491051970ade1bd56bb596eb;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 77b94a4..a240c90 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -1069,19 +1069,25 @@ bool CCECCommandHandler::ActivateSource(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;