X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=cee3c85add8ad84c5c265653d02afebea90108af;hb=1e338e9581ae9669d0f8c85feafdab0a658647c6;hp=2859d5aaddc74dccff69528b2be31ac2a3fb6856;hpb=9924d0b1ca93ede1658cf628a39ae35c075b59f6;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 2859d5a..cee3c85 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -580,7 +580,10 @@ int CCECCommandHandler::HandleSetStreamPath(const cec_command &command) if (device->IsHandledByLibCEC() && !device->IsActiveSource()) device->ActivateSource(); else + { device->MarkAsActiveSource(); + device->TransmitActiveSource(true); + } return COMMAND_HANDLED; } } @@ -910,12 +913,12 @@ bool CCECCommandHandler::TransmitRequestPhysicalAddress(const cec_logical_addres return Transmit(command, !bWaitForResponse, false); } -bool CCECCommandHandler::TransmitRequestPowerStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse /* = true */) +bool CCECCommandHandler::TransmitRequestPowerStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bUpdate, bool bWaitForResponse /* = true */) { if (iDestination == CECDEVICE_TV) { int64_t now(GetTimeMs()); - if (now - m_iPowerStatusRequested < REQUEST_POWER_STATUS_TIMEOUT) + if (!bUpdate && now - m_iPowerStatusRequested < REQUEST_POWER_STATUS_TIMEOUT) return true; m_iPowerStatusRequested = now; } @@ -1207,7 +1210,7 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f bool bTvPresent = (tv && tv->GetStatus() == CEC_DEVICE_STATUS_PRESENT); bool bActiveSourceFailed(false); if (bTvPresent) - bActiveSourceFailed = !m_busDevice->TransmitImageViewOn(); + bActiveSourceFailed = !tv->PowerOn(m_busDevice->GetLogicalAddress()); else LIB_CEC->AddLog(CEC_LOG_DEBUG, "TV not present, not sending 'image view on'"); @@ -1230,6 +1233,14 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f if (playbackDevice && SendDeckStatusUpdateOnActiveSource()) bActiveSourceFailed = !playbackDevice->TransmitDeckStatus(CECDEVICE_TV, false); } + + // update system audio mode for audiosystem devices + if (bTvPresent && !bActiveSourceFailed) + { + CCECAudioSystem* audioDevice = m_busDevice->AsAudioSystem(); + if (audioDevice) + bActiveSourceFailed = !audioDevice->TransmitSetSystemAudioMode(CECDEVICE_TV, false); + } } // retry later