cec: added SetStreamPath()/cec_set_stream_path_logical()/cec_set_stream_path_physical...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index c63bc57666f846a381571eb84d11042fb06ae818..78d24360b6da344ed7471379b9e7b96ee097c118 100644 (file)
@@ -383,6 +383,7 @@ bool CCECProcessor::FindLogicalAddresses(void)
 
 void CCECProcessor::ReplaceHandlers(void)
 {
+  CLockObject lock(m_mutex);
   if (!IsInitialised())
     return;
   for (uint8_t iPtr = 0; iPtr <= CECDEVICE_PLAYBACKDEVICE3; iPtr++)
@@ -636,6 +637,7 @@ bool CCECProcessor::SetPhysicalAddress(uint16_t iPhysicalAddress, bool bSendUpda
   bool bSendActiveView(false);
   bool bReturn(false);
   cec_logical_addresses sendUpdatesTo;
+  sendUpdatesTo.Clear();
 
   {
     CLockObject lock(m_mutex);
@@ -1330,3 +1332,9 @@ bool CCECProcessor::HandleReceiveFailed(cec_logical_address initiator)
 {
   return !m_busDevices[initiator]->HandleReceiveFailed();
 }
+
+bool CCECProcessor::SetStreamPath(uint16_t iPhysicalAddress)
+{
+  // stream path changes are sent by the TV
+  return m_busDevices[CECDEVICE_TV]->GetHandler()->TransmitSetStreamPath(iPhysicalAddress);
+}