From f4bf7b15edc75bcc1307e71f4f31295ecfb7c134 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sat, 8 Oct 2011 18:43:02 +0200 Subject: [PATCH] cec: only report the menu state when the parameter is CEC_MENU_REQUEST_TYPE_QUERY --- src/lib/AdapterCommunication.cpp | 2 -- src/lib/CECProcessor.cpp | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) 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); -- 2.34.1