From 79f01d26761c3ea7bf7833d432c13d276cfc9679 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Wed, 28 Dec 2011 11:58:56 +0100 Subject: [PATCH] cec: move some stuff that doesn't transmit messages from CSLCommandHandler::InitHandler() to the constructor --- src/lib/implementations/SLCommandHandler.cpp | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) 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); -- 2.34.1