cec-client: don't activate the source when starting
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 9c04b423bb2b100b0d0b651b129206023c76e9a5..94d4c7ad4910fedf95a85967bb835ae2c77dcb7c 100644 (file)
@@ -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;
 }
@@ -812,8 +816,11 @@ uint8_t CCECProcessor::MuteAudio(bool bSendRelease /* = true */)
 
 CCECBusDevice *CCECProcessor::GetDeviceByPhysicalAddress(uint16_t iPhysicalAddress, bool bSuppressUpdate /* = true */)
 {
-  if (m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress() == iPhysicalAddress)
-    return m_busDevices[m_configuration.logicalAddresses.primary];
+  if (m_configuration.logicalAddresses.primary != CECDEVICE_UNKNOWN)
+  {
+    if (m_busDevices[m_configuration.logicalAddresses.primary]->GetPhysicalAddress() == iPhysicalAddress)
+      return m_busDevices[m_configuration.logicalAddresses.primary];
+  }
 
   CCECBusDevice *device = NULL;
   for (unsigned int iPtr = 0; iPtr < 16; iPtr++)