cec: missing return statement in CCECCommandHandler::InitHandler()
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index bdabcb74ea23dd99717f0893c968fcc3b0889e47..c78f6438f6f9c7b6d31e72d0ebe7df03de20cecd 100644 (file)
@@ -299,7 +299,11 @@ bool CCECCommandHandler::HandleGivePhysicalAddress(const cec_command &command)
   {
     CCECBusDevice *device = GetDevice(command.destination);
     if (device)
-      return device->TransmitPhysicalAddress();
+    {
+      device->SetActiveSource();
+      return device->TransmitPhysicalAddress() &&
+          device->TransmitActiveSource();
+    }
   }
 
   return false;
@@ -922,3 +926,17 @@ bool CCECCommandHandler::Transmit(cec_command &command, bool bExpectResponse /*
 
   return false;
 }
+
+bool CCECCommandHandler::InitHandler(void)
+{
+  if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
+  {
+    CCECBusDevice *primary = m_processor->m_busDevices[m_processor->GetLogicalAddresses().primary];
+    primary->SetPowerStatus(CEC_POWER_STATUS_ON);
+    primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
+
+    m_processor->SetActiveSource();
+    primary->TransmitMenuState(m_busDevice->GetLogicalAddress());
+  }
+  return true;
+}