From: Lars Op den Kamp Date: Wed, 11 Jan 2012 00:52:37 +0000 (+0100) Subject: cec: don't transmit physical addresses while holding a lock in CCECProcessor X-Git-Tag: upstream/2.2.0~1^2~41^2~13 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4d6f5ac7a660c0b450bff491a16f8bc23944f0ea;p=deb_libcec.git cec: don't transmit physical addresses while holding a lock in CCECProcessor --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 02c1e96..a429216 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -607,6 +607,7 @@ bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress, bool bSendUpda { bool bSendActiveView(false); bool bReturn(false); + cec_logical_addresses sendUpdatesTo; { CLockObject lock(&m_mutex); @@ -620,7 +621,7 @@ bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress, bool bSendUpda m_busDevices[iPtr]->SetInactiveSource(); m_busDevices[iPtr]->SetPhysicalAddress(iPhysicalAddress); if (bSendUpdate) - m_busDevices[iPtr]->TransmitPhysicalAddress(); + sendUpdatesTo.Set((cec_logical_address)iPtr); } bSendActiveView = bWasActiveSource && bSendUpdate; @@ -628,6 +629,10 @@ bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress, bool bSendUpda } } + for (uint8_t iPtr = 0; iPtr < 15; iPtr++) + if (sendUpdatesTo[iPtr]) + m_busDevices[iPtr]->TransmitPhysicalAddress(); + if (bSendActiveView) SetActiveView();