cec: use CCECCommandHandler::ActivateSource() instead of TransmitActiveSource() in...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 3 Jan 2012 14:30:17 +0000 (15:30 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 3 Jan 2012 14:30:17 +0000 (15:30 +0100)
src/lib/CECProcessor.cpp
src/lib/implementations/CECCommandHandler.cpp

index dd7b2fec7147ab86ce0a1240b43aa945140a7c31..bcaea356f210b55676232e55ebfd9dab8b023939 100644 (file)
@@ -417,16 +417,7 @@ 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]->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);
-    }
-  }
+    bReturn = m_busDevices[addr]->GetHandler()->ActivateSource();
 
   return bReturn;
 }
index 9f442be160d6ebf52711cc507c15e932dbb791f7..1773507f54087ecdb516c04999a1c0e40d4b0111 100644 (file)
@@ -988,6 +988,11 @@ bool CCECCommandHandler::ActivateSource(void)
     primary->SetPowerStatus(CEC_POWER_STATUS_ON);
     primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
 
+    if ((m_busDevice->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
+        m_busDevice->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
+        SendDeckStatusUpdateOnActiveSource())
+      ((CCECPlaybackDevice *)m_busDevice)->TransmitDeckStatus(CECDEVICE_TV);
+
     if (m_processor->GetPrimaryDevice()->GetPhysicalAddress(false) != 0xffff)
     {
       m_processor->SetActiveSource();