From: Lars Op den Kamp Date: Wed, 28 Dec 2011 10:58:56 +0000 (+0100) Subject: cec: move some stuff that doesn't transmit messages from CSLCommandHandler::InitHandl... X-Git-Tag: upstream/2.2.0~1^2~43^2~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=79f01d26761c3ea7bf7833d432c13d276cfc9679;p=deb_libcec.git cec: move some stuff that doesn't transmit messages from CSLCommandHandler::InitHandler() to the constructor --- diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index 9cd8ab6..154452d 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -53,6 +53,21 @@ CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) : m_bSLEnabled(false), m_bVendorIdSent(false) { + CCECBusDevice *primary = m_processor->GetPrimaryDevice(); + + /* imitate LG devices */ + if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress()) + primary->SetVendorId(CEC_VENDOR_LG, 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 always return "korean" as language */ + cec_menu_language lang; + lang.device = m_busDevice->GetLogicalAddress(); + snprintf(lang.language, 4, "eng"); + m_busDevice->SetMenuLanguage(lang); } void CSLCommandHandler::SetLGDeckStatus(void) @@ -229,23 +244,8 @@ bool CSLCommandHandler::InitHandler(void) return true; m_bHandlerInited = true; - CCECBusDevice *primary = m_processor->GetPrimaryDevice(); - - /* imitate LG devices */ - if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress()) - primary->SetVendorId(CEC_VENDOR_LG, 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 always return "korean" as language */ - cec_menu_language lang; - lang.device = m_busDevice->GetLogicalAddress(); - snprintf(lang.language, 4, "eng"); - m_busDevice->SetMenuLanguage(lang); - /* reply with LGs vendor id */ + CCECBusDevice *primary = m_processor->GetPrimaryDevice(); if (m_busDevice->GetLogicalAddress() != primary->GetLogicalAddress()) primary->TransmitVendorID(CECDEVICE_TV, false);