X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2FCECProcessor.cpp;h=f4e485ac3b6da0a7e3c01462780c037fc744c290;hb=ed63a5152ee6f0283fd32d1e304df9e7c7dd03e5;hp=230f2ab0388f4e937b97a27f10a33f92991ee16b;hpb=49c8f2e44d5f34e98ab669e1c132d9ccd669468f;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 230f2ab..f4e485a 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -64,6 +64,11 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const libcec_configuration *co { m_logicalAddresses.Clear(); CreateBusDevices(); + if (configuration->tvVendor != CEC_VENDOR_UNKNOWN) + { + m_busDevices[CECDEVICE_TV]->SetVendorId((uint64_t)configuration->tvVendor); + m_busDevices[CECDEVICE_TV]->ReplaceHandler(false); + } } CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types, uint16_t iPhysicalAddress, cec_client_version clientVersion) : @@ -211,10 +216,10 @@ bool CCECProcessor::Initialise(void) /* get the vendor id from the TV, so we are using the correct handler */ m_busDevices[CECDEVICE_TV]->RequestVendorId(); - ReplaceHandlers(); if (m_iPhysicalAddress != 0) { + CLibCEC::AddLog(CEC_LOG_NOTICE, "setting the physical address to %4x", m_iPhysicalAddress); m_busDevices[m_logicalAddresses.primary]->m_iPhysicalAddress = m_iPhysicalAddress; if ((bReturn = m_busDevices[m_logicalAddresses.primary]->TransmitPhysicalAddress()) == false) CLibCEC::AddLog(CEC_LOG_ERROR, "unable to set the physical address to %4x", m_iPhysicalAddress); @@ -406,7 +411,6 @@ bool CCECProcessor::FindLogicalAddresses(void) void CCECProcessor::ReplaceHandlers(void) { - CLockObject lock(m_mutex); if (!IsInitialised()) return; for (uint8_t iPtr = 0; iPtr <= CECDEVICE_PLAYBACKDEVICE3; iPtr++) @@ -460,23 +464,7 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE m_busDevices[addr]->SetActiveSource(); if (m_busDevices[addr]->GetPhysicalAddress(false) != 0xFFFF) - { - bReturn = m_busDevices[addr]->TransmitImageViewOn() && - m_busDevices[addr]->TransmitActiveSource(); - - if (bReturn) - { - m_busDevices[addr]->SetMenuState(CEC_MENU_STATE_ACTIVATED); - m_busDevices[addr]->TransmitMenuState(CECDEVICE_TV); - } - - if (bReturn && (m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE || - m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) && - m_busDevices[addr]->GetHandler()->SendDeckStatusUpdateOnActiveSource()) - { - bReturn = ((CCECPlaybackDevice *)m_busDevices[addr])->TransmitDeckStatus(CECDEVICE_TV); - } - } + bReturn = m_busDevices[addr]->ActivateSource(); return bReturn; }