X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FCECCommandHandler.cpp;h=37e3ddae785c366fcd4694538b90f152b7b3ea5f;hb=ee0902523575b4aea09b5ad29e184ee061c1d647;hp=eed60878d8231244346e80756ef45f39081f9d5d;hpb=a75e3a5a63546d6f7e670bc2a7a1931887a5d2a0;p=deb_libcec.git diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index eed6087..37e3dda 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -334,12 +334,7 @@ bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command &command) { CCECBusDevice *device = GetDevice(command.destination); if (device) - { - device->SetActiveSource(); - return device->TransmitPhysicalAddress() && - device->TransmitImageViewOn() && - device->TransmitActiveSource(); - } + return device->TransmitPhysicalAddress(); } return false; @@ -379,11 +374,20 @@ bool CCECCommandHandler::HandleMenuRequest(const cec_command &command) { if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) { - if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_QUERY) + CCECBusDevice *device = GetDevice(command.destination); + if (device) { - CCECBusDevice *device = GetDevice(command.destination); - if (device) - return device->TransmitMenuState(command.initiator); + if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_ACTIVATE) + { + if (CLibCEC::MenuStateChanged(CEC_MENU_STATE_ACTIVATED) == 1) + device->SetMenuState(CEC_MENU_STATE_ACTIVATED); + } + else if (command.parameters[0] == CEC_MENU_REQUEST_TYPE_DEACTIVATE) + { + if (CLibCEC::MenuStateChanged(CEC_MENU_STATE_DEACTIVATED) == 1) + device->SetMenuState(CEC_MENU_STATE_DEACTIVATED); + } + return device->TransmitMenuState(command.initiator); } } @@ -1006,7 +1010,7 @@ bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /* } { - uint8_t iTries(0), iMaxTries(command.opcode == CEC_OPCODE_NONE ? 1 : m_iTransmitRetries + 1); + uint8_t iTries(0), iMaxTries(!command.opcode_set ? 1 : m_iTransmitRetries + 1); while (!bReturn && ++iTries <= iMaxTries) { if ((bReturn = m_processor->Transmit(command)) == true)