X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=1eb272aa7197ba51db4c851b3cad825a0b706f36;hb=f60ee8b35a31f8795658407a6863425a2c5c84d7;hp=b4445f42f921881edb6361d57f45a7498c62136f;hpb=7d27bafc81161bf5d86e4d5bf2e833ca72d1d130;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index b4445f4..1eb272a 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -887,10 +887,18 @@ void CCECProcessor::SwitchMonitoring(bool bSwitchTo) UnregisterClients(); } -void CCECProcessor::HandleLogicalAddressLost(cec_logical_address address) +void CCECProcessor::HandleLogicalAddressLost(cec_logical_address oldAddress, cec_logical_address newAddress) { - m_libcec->AddLog(CEC_LOG_NOTICE, "logical address %x was taken by another device, re-registering the client"); - CCECClient* client = GetClient(address); + m_libcec->AddLog(CEC_LOG_NOTICE, "logical address %x was taken by another device, changed to %x", oldAddress, newAddress); + CCECClient* client = GetClient(oldAddress); if (client) - RegisterClient(client); + { + if (newAddress == CECDEVICE_UNKNOWN) + UnregisterClient(client); + else + { + client->m_configuration.logicalAddresses.Unset(oldAddress); + client->m_configuration.logicalAddresses.Set(newAddress); + } + } }