cec: replace the command handler directly after receiving a changed vendor id. change...
[deb_libcec.git] / src / lib / implementations / VLCommandHandler.cpp
index fbbfa290c9b021690eca84182f97f1737d783257..257a8f398c463b9ba1cd10d0c1f6cc3072e555c1 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "VLCommandHandler.h"
 #include "../devices/CECBusDevice.h"
-#include "../util/StdString.h"
+#include "../CECProcessor.h"
 
 using namespace CEC;
 
@@ -40,3 +40,13 @@ CVLCommandHandler::CVLCommandHandler(CCECBusDevice *busDevice) :
     CCECCommandHandler(busDevice)
 {
 }
+
+bool CVLCommandHandler::InitHandler(void)
+{
+  CCECBusDevice *primary = m_processor->GetPrimaryDevice();
+  if (primary->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE)
+  {
+    return m_processor->ChangeDeviceType(CEC_DEVICE_TYPE_RECORDING_DEVICE, CEC_DEVICE_TYPE_PLAYBACK_DEVICE);
+  }
+  return CCECCommandHandler::InitHandler();
+}