Revert "cec: use CCECCommandHandler::ActivateSource() instead of TransmitActiveSource...
[deb_libcec.git] / src / lib / CECProcessor.cpp
index 6b401252f2bf289d958b4c69aecbcf4a13b3f7b9..e0a32a8c0d26e7646396d3146ee768c48684a52c 100644 (file)
@@ -417,7 +417,16 @@ bool CCECProcessor::SetActiveSource(cec_device_type type /* = CEC_DEVICE_TYPE_RE
 
   m_busDevices[addr]->SetActiveSource();
   if (m_busDevices[addr]->GetPhysicalAddress(false) != 0xFFFF)
-    bReturn = m_busDevices[addr]->GetHandler()->ActivateSource();
+  {
+    bReturn = m_busDevices[addr]->TransmitActiveSource();
+
+    if (bReturn && (m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
+        m_busDevices[addr]->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
+        m_busDevices[addr]->GetHandler()->SendDeckStatusUpdateOnActiveSource())
+    {
+      bReturn = ((CCECPlaybackDevice *)m_busDevices[addr])->TransmitDeckStatus(CECDEVICE_TV);
+    }
+  }
 
   return bReturn;
 }
@@ -488,14 +497,12 @@ bool CCECProcessor::SetDeckInfo(cec_deck_info info, bool bSendUpdate /* = true *
 bool CCECProcessor::SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, bool bForce /* = false */)
 {
   bool bReturn(false);
-  {
-    CLockObject lock(&m_mutex);
+  CLockObject lock(&m_mutex);
 
-    m_iBaseDevice = iBaseDevice;
-    m_iHDMIPort = iPort;
-    if (!m_bStarted && !bForce)
-      return true;
-  }
+  m_iBaseDevice = iBaseDevice;
+  m_iHDMIPort = iPort;
+  if (!m_bStarted && !bForce)
+    return true;
 
   CStdString strLog;
   strLog.Format("setting HDMI port to %d on device %s (%d)", iPort, ToString(iBaseDevice), (int)iBaseDevice);