X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FSLCommandHandler.cpp;h=957d296a8a8733dfbf6ec8bf3931ffab67a92ddb;hb=3c5b4d054fc5067655c2001e0cfb9e1186a5ae15;hp=e8cdf43f8e4d10128e0fc76ef6dc992b8a9755d7;hpb=bbc71623d650a4f17057da7d218a824c0c95b3d3;p=deb_libcec.git diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index e8cdf43..957d296 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -68,9 +68,8 @@ CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) : primary->ReplaceHandler(false); } - /* LG TVs don't always reply to CEC version requests, so just set it to 1.3a */ - if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV) - m_busDevice->SetCecVersion(CEC_VERSION_1_3A); + /* LG devices don't always reply to CEC version requests, so just set it to 1.3a */ + m_busDevice->SetCecVersion(CEC_VERSION_1_3A); /* LG devices always return "korean" as language */ cec_menu_language lang; @@ -153,7 +152,7 @@ bool CSLCommandHandler::HandleDeviceVendorId(const cec_command &command) { cec_command response; cec_command::Format(response, m_processor->GetLogicalAddress(), command.initiator, CEC_OPCODE_FEATURE_ABORT); - return Transmit(response); + return Transmit(response, false); } return true; } @@ -229,7 +228,17 @@ void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command) { SetSLInitialised(); device->SetActiveSource(); - ActivateSource(); + device->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON); + device->TransmitPowerState(command.initiator); + + CEvent::Sleep(2000); + device->SetPowerStatus(CEC_POWER_STATUS_ON); + device->TransmitPowerState(command.initiator); + device->TransmitPhysicalAddress(); + { + CLockObject lock(m_SLMutex); + m_bActiveSourceSent = false; + } } } void CSLCommandHandler::HandleVendorCommandPowerOnStatus(const cec_command &command) @@ -273,7 +282,8 @@ bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command) if (command.parameters[0] == CEC_STATUS_REQUEST_ON) { bool bReturn = ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator); - ActivateSource(); + if (!ActiveSourceSent()) + ActivateSource(); return bReturn; } else if (command.parameters[0] == CEC_STATUS_REQUEST_ONCE) @@ -401,10 +411,14 @@ bool CSLCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_ { /* LG devices only allow themselves to be woken up by the TV with a vendor command */ cec_command command; + + if (!m_bSLEnabled) + TransmitVendorID(CECDEVICE_TV, CEC_VENDOR_LG); + cec_command::Format(command, CECDEVICE_TV, iDestination, CEC_OPCODE_VENDOR_COMMAND); command.PushBack(SL_COMMAND_POWER_ON); command.PushBack(0); - return Transmit(command); + return Transmit(command, false); } return CCECCommandHandler::PowerOn(iInitiator, iDestination);