X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=fa063f4e52d47209bf3b223228c939b683602652;hb=d4a56bb9a13f82653a9d56a448671d0e8b5c8c42;hp=3e44752cc7dd2adfabbbc4319857d4d7b41b5f6f;hpb=ebcedb051be7d8e1e19ecd3f0aa164baae252400;p=deb_libcec.git diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 3e44752..fa063f4 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -186,7 +186,7 @@ bool CCECBusDevice::HandleCommand(const cec_command &command) bHandled = m_handler->HandleCommand(command); /* change status to present */ - if (bHandled && GetLogicalAddress() != CECDEVICE_BROADCAST) + if (bHandled && GetLogicalAddress() != CECDEVICE_BROADCAST && command.opcode_set == 1) { CLockObject lock(m_mutex); if (m_deviceStatus != CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC) @@ -227,7 +227,9 @@ void CCECBusDevice::SetUnsupportedFeature(cec_opcode opcode) opcode == CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP || opcode == CEC_OPCODE_ABORT || opcode == CEC_OPCODE_FEATURE_ABORT || - opcode == CEC_OPCODE_NONE) + opcode == CEC_OPCODE_NONE || + opcode == CEC_OPCODE_USER_CONTROL_PRESSED || + opcode == CEC_OPCODE_USER_CONTROL_RELEASE) return; { @@ -391,12 +393,13 @@ bool CCECBusDevice::TransmitSetMenuLanguage(const cec_logical_address destinatio language = m_menuLanguage; } - char lang[3]; + char lang[4]; { CLockObject lock(m_mutex); lang[0] = language.language[0]; lang[1] = language.language[1]; lang[2] = language.language[2]; + lang[3] = (char)0; } MarkBusy(); @@ -748,7 +751,7 @@ bool CCECBusDevice::TransmitVendorID(const cec_logical_address destination, bool else { LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id %s (%x)", GetLogicalAddressName(), m_iLogicalAddress, ToString(destination), destination, ToString((cec_vendor_id)iVendorId), iVendorId); - bReturn = m_handler->TransmitVendorID(m_iLogicalAddress, iVendorId, bIsReply); + bReturn = m_handler->TransmitVendorID(m_iLogicalAddress, destination, iVendorId, bIsReply); } MarkReady(); return bReturn; @@ -1130,23 +1133,15 @@ void CCECBusDevice::SetActiveRoute(uint16_t iRoute) if (!map) return; - CCECBusDevice* previouslyActive = map->GetActiveSource(); - if (!previouslyActive) - return; - - CECDEVICEVEC devices; - m_processor->GetDevices()->GetChildrenOf(devices, this); - - for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++) - { - if (!CCECTypeUtils::PhysicalAddressIsIncluded(iRoute, (*it)->GetCurrentPhysicalAddress())) - (*it)->MarkAsInactiveSource(); - } + CCECBusDevice* newRoute = m_processor->GetDeviceByPhysicalAddress(iRoute, true); + if (newRoute && newRoute->IsHandledByLibCEC()) + newRoute->ActivateSource(); } void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */) { - SetPowerStatus(CEC_POWER_STATUS_ON); + if (iNewAddress != CEC_INVALID_PHYSICAL_ADDRESS) + SetPowerStatus(CEC_POWER_STATUS_ON); CLockObject lock(m_mutex); if (iNewAddress != m_iStreamPath)