transmit an abort message when the vendor id is requested for philips, instead of...
[deb_libcec.git] / src / lib / implementations / PHCommandHandler.cpp
index 0d9f010800b5775fb905f717cb1109453eb9b6e6..b46f69e06bfb53cf80727744eff943ca61209f93 100644 (file)
@@ -129,9 +129,8 @@ bool CPHCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = fa
 
 int CPHCommandHandler::HandleUserControlPressed(const cec_command& command)
 {
-  // tv keeps sending these until a button is pressed
-  if (command.parameters[0] == CEC_USER_CONTROL_CODE_DISPLAY_INFORMATION &&
-      m_iLastKeyCode == CEC_USER_CONTROL_CODE_DISPLAY_INFORMATION)
+  // TV sometimes keeps sending key presses without releases
+  if (m_iLastKeyCode == command.parameters[0])
     return COMMAND_HANDLED;
 
   m_iLastKeyCode = command.parameters[0];
@@ -152,9 +151,9 @@ int CPHCommandHandler::HandleDeviceVendorId(const cec_command& command)
   return CCECCommandHandler::HandleDeviceVendorId(command);
 }
 
-int CPHCommandHandler::HandleGiveDeviceVendorId(const cec_command& command)
+bool CPHCommandHandler::TransmitVendorID(const cec_logical_address iInitiator, const cec_logical_address iDestination, uint64_t UNUSED(iVendorId), bool UNUSED(bIsReply))
 {
-  LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id feature abort", ToString(command.destination), command.destination, ToString(command.initiator), command.initiator);
-  m_processor->TransmitAbort(command.destination, command.initiator, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
-  return COMMAND_HANDLED;
+  LIB_CEC->AddLog(CEC_LOG_DEBUG, "<< %s (%X) -> %s (%X): vendor id feature abort", ToString(iInitiator), iInitiator, ToString(iDestination), iDestination);
+  m_processor->TransmitAbort(iInitiator, iDestination, CEC_OPCODE_GIVE_DEVICE_VENDOR_ID);
+  return true;
 }