From: Lars Op den Kamp Date: Thu, 26 Apr 2012 11:42:15 +0000 (+0200) Subject: cec: set the initial stream path to PA 0xFFFF instead of 0x0. added some logging X-Git-Tag: upstream/2.2.0~1^2~29^2^2~25 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f818ec6ca449d37bf3c6f898add6a54a8ceb6d67;p=deb_libcec.git cec: set the initial stream path to PA 0xFFFF instead of 0x0. added some logging --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index efe038f..94d4c7a 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -542,6 +542,10 @@ bool CCECProcessor::SetActiveSource(uint16_t iStreamPath) device->SetActiveSource(); bReturn = true; } + else + { + CLibCEC::AddLog(CEC_LOG_DEBUG, "device with PA '%04x' not found", iStreamPath); + } return bReturn; } diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index c688162..d7ee806 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -540,6 +540,8 @@ void CCECBusDevice::SetActiveSource(void) CLockObject lock(m_mutex); if (!m_bActiveSource) CLibCEC::AddLog(CEC_LOG_DEBUG, "making %s (%x) the active source", GetLogicalAddressName(), m_iLogicalAddress); + else + CLibCEC::AddLog(CEC_LOG_DEBUG, "%s (%x) was already marked as active source", GetLogicalAddressName(), m_iLogicalAddress); for (int iPtr = 0; iPtr < 16; iPtr++) if (iPtr != m_iLogicalAddress) @@ -574,7 +576,7 @@ void CCECBusDevice::ResetDeviceStatus(void) SetVendorId (CEC_VENDOR_UNKNOWN); SetMenuState (CEC_MENU_STATE_ACTIVATED); SetCecVersion (CEC_VERSION_UNKNOWN); - SetStreamPath (0); + SetStreamPath (0xFFFF); SetOSDName (ToString(m_iLogicalAddress)); SetInactiveSource(); m_iLastActive = 0; @@ -600,7 +602,7 @@ void CCECBusDevice::SetDeviceStatus(const cec_bus_device_status newStatus) SetVendorId (CEC_VENDOR_UNKNOWN); SetMenuState (CEC_MENU_STATE_ACTIVATED); SetCecVersion (CEC_VERSION_1_3A); - SetStreamPath (0); + SetStreamPath (0xFFFF); SetInactiveSource(); m_iLastActive = 0; m_deviceStatus = newStatus; @@ -643,6 +645,10 @@ void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* CLibCEC::AddLog(CEC_LOG_DEBUG, ">> %s (%X): stream path changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress, iOldAddress == 0 ? m_iStreamPath : iOldAddress, iNewAddress); m_iStreamPath = iNewAddress; } + else + { + CLibCEC::AddLog(CEC_LOG_DEBUG, "%s (%X): stream path unchanged (%04x)", GetLogicalAddressName(), m_iLogicalAddress, m_iStreamPath); + } CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iNewAddress); if (device) diff --git a/src/lib/implementations/CECCommandHandler.cpp b/src/lib/implementations/CECCommandHandler.cpp index 1e47782..5fa83ed 100644 --- a/src/lib/implementations/CECCommandHandler.cpp +++ b/src/lib/implementations/CECCommandHandler.cpp @@ -460,8 +460,6 @@ bool CCECCommandHandler::HandleRoutingChange(const cec_command &command) CCECBusDevice *device = GetDevice(command.initiator); if (device) device->SetStreamPath(iNewAddress, iOldAddress); - else - CLibCEC::AddLog(CEC_LOG_DEBUG, "initiator device not found"); } return true; }