cec: don't send a deck status update when sending an active source message for panaso...
[deb_libcec.git] / src / lib / implementations / VLCommandHandler.cpp
index 89f5b2eadebc5668436040c68b841e4c4b798f0d..dfef4a09e75dfa46e8c66572e0dfd663dc58bec1 100644 (file)
 
 #include "VLCommandHandler.h"
 #include "../devices/CECBusDevice.h"
-#include "../util/StdString.h"
+#include "../CECProcessor.h"
 
 using namespace CEC;
 
 CVLCommandHandler::CVLCommandHandler(CCECBusDevice *busDevice) :
     CCECCommandHandler(busDevice)
 {
+  m_bOPTSendDeckStatusUpdateOnActiveSource = false;
 }
 
-bool CVLCommandHandler::HandleSetStreamPath(const cec_command &command)
+bool CVLCommandHandler::InitHandler(void)
 {
-  if (command.parameters.size >= 2)
+  CCECBusDevice *primary = m_processor->GetPrimaryDevice();
+  if (primary->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE)
   {
-    int streamaddr = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
-    CStdString strLog;
-    strLog.Format(">> %i requests stream path from physical address %04x", command.initiator, streamaddr);
-    m_busDevice->AddLog(CEC_LOG_DEBUG, strLog.c_str());
-    if (streamaddr == m_busDevice->GetMyPhysicalAddress())
-    {
-      CCECBusDevice *device = GetThisDevice();
-      CCECBusDevice *initiatorDevice = GetDevice(command.initiator);
-      if (device && initiatorDevice)
-      {
-        return device->BroadcastActiveSource() &&
-               device->BroadcastActiveView() &&
-               initiatorDevice->ReportMenuState();
-      }
-      return false;
-    }
+    return m_processor->ChangeDeviceType(CEC_DEVICE_TYPE_RECORDING_DEVICE, CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
   }
-  return true;
+  return CCECCommandHandler::InitHandler();
 }