cec: reconnect SL after TV standby
authorLars Op den Kamp <lars@opdenkamp.eu>
Sun, 12 Feb 2012 19:32:30 +0000 (20:32 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sun, 12 Feb 2012 19:32:30 +0000 (20:32 +0100)
src/lib/implementations/SLCommandHandler.cpp
src/lib/implementations/SLCommandHandler.h

index 1d4c8c5a70605ae75db52a019a88d21e94432b6c..7b3b427af2f4154f8a449851f50c15d2aa0e49cf 100644 (file)
@@ -292,3 +292,30 @@ bool CSLCommandHandler::HandleRequestActiveSource(const cec_command &command)
   }
   return false;
 }
+
+bool CSLCommandHandler::HandleFeatureAbort(const cec_command &command)
+{
+  if (command.parameters.size == 0 && m_processor->GetPrimaryDevice()->GetPowerStatus() == CEC_POWER_STATUS_ON && !m_bSLEnabled)
+  {
+    m_processor->GetPrimaryDevice()->TransmitPowerState(command.initiator);
+    m_processor->GetPrimaryDevice()->TransmitVendorID(CECDEVICE_BROADCAST, false);
+  }
+
+  return CCECCommandHandler::HandleFeatureAbort(command);
+}
+
+bool CSLCommandHandler::HandleStandby(const cec_command &command)
+{
+  if (command.initiator == CECDEVICE_TV)
+  {
+    m_bSLEnabled = false;
+    m_bPowerStateReset = false;
+    m_bActiveSourceSent = false;
+  }
+
+  CCECBusDevice *device = GetDevice(command.initiator);
+  if (device)
+    device->SetPowerStatus(CEC_POWER_STATUS_STANDBY);
+
+  return true;
+}
index e24dac7ee9b61770718ae43238879a6b206b458e..8012f2e8913f1a59bca341ef148e4beaeb77d120 100644 (file)
@@ -62,6 +62,8 @@ namespace CEC
     virtual bool HandleGiveDevicePowerStatus(const cec_command &command);
     virtual bool HandleGiveDeckStatus(const cec_command &command);
     virtual bool HandleRequestActiveSource(const cec_command &command);
+    virtual bool HandleFeatureAbort(const cec_command &command);
+    virtual bool HandleStandby(const cec_command &command);
 
     bool    m_bSLEnabled;
     bool    m_bPowerStateReset;