From ad7e06961618883aebcc5d6618378dc3061665c8 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Thu, 26 Apr 2012 12:54:13 +0200 Subject: [PATCH] cec: never mark vendor commands as unsupported (only some may be unsupported), as well as some others that should never be marked unsupported --- src/lib/devices/CECBusDevice.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 2e78118..3f5185e 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -1038,10 +1038,23 @@ bool CCECBusDevice::IsUnsupportedFeature(cec_opcode opcode) void CCECBusDevice::SetUnsupportedFeature(cec_opcode opcode) { + // some commands should never be marked as unsupported + if (opcode == CEC_OPCODE_VENDOR_COMMAND || + opcode == CEC_OPCODE_VENDOR_COMMAND_WITH_ID || + opcode == CEC_OPCODE_VENDOR_REMOTE_BUTTON_DOWN || + opcode == CEC_OPCODE_VENDOR_REMOTE_BUTTON_UP || + opcode == CEC_OPCODE_ABORT || + opcode == CEC_OPCODE_FEATURE_ABORT || + opcode == CEC_OPCODE_NONE) + return; + { CLockObject lock(m_mutex); - CLibCEC::AddLog(CEC_LOG_DEBUG, "marking opcode '%s' as unsupported feature for device '%s'", ToString(opcode), GetLogicalAddressName()); - m_unsupportedFeatures.insert(opcode); + if (m_unsupportedFeatures.find(opcode) == m_unsupportedFeatures.end()) + { + CLibCEC::AddLog(CEC_LOG_DEBUG, "marking opcode '%s' as unsupported feature for device '%s'", ToString(opcode), GetLogicalAddressName()); + m_unsupportedFeatures.insert(opcode); + } } // signal threads that are waiting for a reponse -- 2.34.1