From: Lars Op den Kamp Date: Sat, 8 Oct 2011 16:43:02 +0000 (+0200) Subject: cec: only report the menu state when the parameter is CEC_MENU_REQUEST_TYPE_QUERY X-Git-Tag: upstream/2.2.0~1^2~265 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;ds=sidebyside;h=f4bf7b15edc75bcc1307e71f4f31295ecfb7c134;p=deb_libcec.git cec: only report the menu state when the parameter is CEC_MENU_REQUEST_TYPE_QUERY --- diff --git a/src/lib/AdapterCommunication.cpp b/src/lib/AdapterCommunication.cpp index aeecf3a..cc83320 100644 --- a/src/lib/AdapterCommunication.cpp +++ b/src/lib/AdapterCommunication.cpp @@ -188,8 +188,6 @@ bool CAdapterCommunication::Write(const cec_frame &data) } m_controller->AddLog(CEC_LOG_DEBUG, "command sent"); - - CCondition::Sleep((uint32_t) data.size * (uint32_t)24 /*data*/ + (uint32_t)5 /*start bit (4.5 ms)*/); } return true; diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index a313e09..964f359 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -241,6 +241,8 @@ bool CCECProcessor::TransmitFormatted(const cec_frame &data, bool bWaitForAck /* if (!m_communication || !m_communication->Write(data)) return false; + CCondition::Sleep((uint32_t) data.size * (uint32_t)24 /*data*/ + (uint32_t)5 /*start bit (4.5 ms)*/); + if (bWaitForAck) { uint64_t now = GetTimeMs(); @@ -579,7 +581,9 @@ void CCECProcessor::ParseCurrentFrame(cec_frame &frame) TransmitAbort((cec_logical_address)initiator, CEC_OPCODE_GIVE_DECK_STATUS); break; case CEC_OPCODE_MENU_REQUEST: - ReportMenuState((cec_logical_address)initiator); + frame.shift(2); + if (frame.data[0] == CEC_MENU_REQUEST_TYPE_QUERY) + ReportMenuState((cec_logical_address)initiator); break; case CEC_OPCODE_GIVE_DEVICE_POWER_STATUS: ReportPowerState((cec_logical_address)initiator);