X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=e957a371c7a7c00fa2901a8b067c504938a7c80b;hb=8cdaa0596e85ac4d3997be1e1f0d142e5b1c38ee;hp=9b44d3b1da22c2a2f78a04e1ac345878e15c2c9a;hpb=fa4b80dfb92e15862041715cd3f1cbbf3f244f1e;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 9b44d3b..e957a37 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -187,7 +187,7 @@ bool CCECProcessor::OpenConnection(const char *strPort, uint16_t iBaudRate, uint /* open a new connection */ unsigned iConnectTry(0); - while (timeout.TimeLeft() > 0 && (bReturn = m_communication->Open(this, (timeout.TimeLeft() / CEC_CONNECT_TRIES), false, bStartListening)) == false) + while (timeout.TimeLeft() > 0 && (bReturn = m_communication->Open((timeout.TimeLeft() / CEC_CONNECT_TRIES), false, bStartListening)) == false) { CLibCEC::AddLog(CEC_LOG_ERROR, "could not open a connection (try %d)", ++iConnectTry); m_communication->Close(); @@ -514,7 +514,8 @@ bool CCECProcessor::SetActiveSource(uint16_t iStreamPath) { bool bReturn(false); - CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath); + // suppress polls when searching for a device + CCECBusDevice *device = GetDeviceByPhysicalAddress(iStreamPath, false, true); if (device) { device->SetActiveSource(); @@ -779,7 +780,7 @@ uint8_t CCECProcessor::MuteAudio(bool bSendRelease /* = true */) return status; } -CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bRefresh /* = false */) const +CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bRefresh /* = false */, bool bSuppressPoll /* = false */) const { if (m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress(false) == iPhysicalAddress) return m_busDevices[m_configuration.logicalAddresses.primary]; @@ -787,7 +788,7 @@ CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddre CCECBusDevice *device = NULL; for (unsigned int iPtr = 0; iPtr < 16; iPtr++) { - if (m_busDevices[iPtr]->GetPhysicalAddress(bRefresh) == iPhysicalAddress) + if (m_busDevices[iPtr]->GetPhysicalAddress(bRefresh, bSuppressPoll) == iPhysicalAddress) { device = m_busDevices[iPtr]; break; @@ -1505,7 +1506,8 @@ bool CCECProcessor::PingAdapter(void) void CCECProcessor::HandlePoll(cec_logical_address initiator, cec_logical_address destination) { - m_busDevices[destination]->HandlePoll(initiator); + if (destination < CECDEVICE_BROADCAST) + m_busDevices[destination]->HandlePollFrom(initiator); } bool CCECProcessor::HandleReceiveFailed(cec_logical_address initiator)