X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=796f7aba72b6d9aa63737542ba61f674b3d7b483;hb=c4a070bea25853e9532008117bf47720ce0cfa50;hp=269cbde0d183fbdef4411fa4cc1f975c05869337;hpb=39334ff26dafc43f6400915d8505155ce98a585a;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 269cbde..796f7ab 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -1121,7 +1121,13 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f VendorPreActivateSourceHook(); // power on the TV - bool bActiveSourceFailed = !m_busDevice->TransmitImageViewOn(); + CCECBusDevice* tv = m_processor->GetDevice(CECDEVICE_TV); + bool bTvPresent = (tv && tv->GetStatus() == CEC_DEVICE_STATUS_PRESENT); + bool bActiveSourceFailed(false); + if (bTvPresent) + bActiveSourceFailed = !m_busDevice->TransmitImageViewOn(); + else + LIB_CEC->AddLog(CEC_LOG_DEBUG, "TV not present, not sending 'image view on'"); // check if we're allowed to switch sources bool bSourceSwitchAllowed = SourceSwitchAllowed(); @@ -1131,11 +1137,12 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f // switch sources (if allowed) if (!bActiveSourceFailed && bSourceSwitchAllowed) { - bActiveSourceFailed = !m_busDevice->TransmitActiveSource(false) || - !m_busDevice->TransmitMenuState(CECDEVICE_TV, false); + bActiveSourceFailed = !m_busDevice->TransmitActiveSource(false); + if (bTvPresent && !bActiveSourceFailed) + bActiveSourceFailed = !m_busDevice->TransmitMenuState(CECDEVICE_TV, false); // update the deck status for playback devices - if (!bActiveSourceFailed) + if (bTvPresent && !bActiveSourceFailed) { CCECPlaybackDevice *playbackDevice = m_busDevice->AsPlaybackDevice(); if (playbackDevice && SendDeckStatusUpdateOnActiveSource())