void CCECPlaybackDevice::SetDeckStatus(cec_deck_info deckStatus)
{
CLockObject lock(m_mutex);
- if (m_deckStatus != deckStatus && m_deckStatus != CEC_DECK_INFO_OTHER_STATUS_LG)
+ if (m_deckStatus != deckStatus)
{
CLibCEC::AddLog(CEC_LOG_DEBUG, ">> %s (%X): deck status changed from '%s' to '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_deckStatus), ToString(deckStatus));
m_deckStatus = deckStatus;
/* imitate LG devices */
if (primary && m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress())
primary->SetVendorId(CEC_VENDOR_LG);
- SetLGDeckStatus();
+ SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
/* LG TVs don't always reply to CEC version requests, so just set it to 1.3a */
if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
device->TransmitPowerState(command.initiator);
device->SetPowerStatus(CEC_POWER_STATUS_ON);
- SetLGDeckStatus();
+ SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
device->SetActiveSource();
TransmitImageViewOn(device->GetLogicalAddress(), command.initiator);
}
void CSLCommandHandler::HandleVendorCommandSLConnect(const cec_command &command)
{
m_bSLEnabled = true;
- SetLGDeckStatus();
-
CCECBusDevice *primary = m_processor->GetPrimaryDevice();
- primary->SetActiveSource();
TransmitVendorCommand05(primary->GetLogicalAddress(), command.initiator);
+
+ CCECPlaybackDevice *playback = (primary->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || primary->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) ?
+ (CCECPlaybackDevice *)primary : NULL;
+ if (playback)
+ {
+ SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS);
+ playback->TransmitDeckStatus(CECDEVICE_TV);
+ PLATFORM::CEvent::Sleep(2000);
+ }
+
+ primary->SetActiveSource();
+ primary->TransmitImageViewOn();
+
+ SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
+ if (playback)
+ playback->TransmitDeckStatus(CECDEVICE_TV);
}
void CSLCommandHandler::TransmitVendorCommand05(const cec_logical_address iSource, const cec_logical_address iDestination)
Transmit(response, false);
}
-void CSLCommandHandler::SetLGDeckStatus(void)
+void CSLCommandHandler::SetDeckStatus(cec_deck_info deckStatus)
{
- /* LG TVs only route keypresses when the deck status is set to 0x20 */
CCECBusDevice *device = m_processor->GetDeviceByType(CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
if (device)
- ((CCECPlaybackDevice *)device)->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
+ ((CCECPlaybackDevice *)device)->SetDeckStatus(deckStatus);
device = m_processor->GetDeviceByType(CEC_DEVICE_TYPE_RECORDING_DEVICE);
if (device)
- ((CCECPlaybackDevice *)device)->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
+ ((CCECPlaybackDevice *)device)->SetDeckStatus(deckStatus);
}