From: Lars Op den Kamp Date: Tue, 24 Apr 2012 23:06:40 +0000 (+0200) Subject: only request the build date once X-Git-Tag: upstream/2.2.0~1^2~29^2^2~43 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c37545cf1873b9e4f735b227206ba57ad3b20a93;p=deb_libcec.git only request the build date once --- diff --git a/src/lib/adapter/USBCECAdapterCommands.cpp b/src/lib/adapter/USBCECAdapterCommands.cpp index 326abe1..5989bc9 100644 --- a/src/lib/adapter/USBCECAdapterCommands.cpp +++ b/src/lib/adapter/USBCECAdapterCommands.cpp @@ -123,12 +123,15 @@ bool CUSBCECAdapterCommands::RequestSettingCECVersion(void) uint32_t CUSBCECAdapterCommands::RequestBuildDate(void) { - CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting firmware build date"); + if (m_iBuildDate == 0) + { + CLibCEC::AddLog(CEC_LOG_DEBUG, "requesting firmware build date"); - cec_datapacket response = RequestSetting(MSGCODE_GET_BUILDDATE); - if (response.size == 4) - return (uint32_t)response[0] << 24 | (uint32_t)response[1] << 16 | (uint32_t)response[2] << 8 | (uint32_t)response[3]; - return 0; + cec_datapacket response = RequestSetting(MSGCODE_GET_BUILDDATE); + if (response.size == 4) + m_iBuildDate = (uint32_t)response[0] << 24 | (uint32_t)response[1] << 16 | (uint32_t)response[2] << 8 | (uint32_t)response[3]; + } + return m_iBuildDate; } bool CUSBCECAdapterCommands::RequestSettingDefaultLogicalAddress(void)