From: Lars Op den Kamp Date: Mon, 25 Feb 2013 00:49:34 +0000 (+0100) Subject: Revert "rpi: don't try to release the logical address (and fail). fix verified by... X-Git-Tag: upstream/2.2.0~1^2~6^2~8 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6bba6e2c6a92ac23e5644594162d131c24a2ed0b;p=deb_libcec.git Revert "rpi: don't try to release the logical address (and fail). fix verified by the logs in https://github.com/Pulse-Eight/libcec/issues/111#issuecomment-12728216" and "rpi: don't wait for a response (and fail) when opening a connection. issue #109" This reverts commits ab2ab9ee1ac85713acdd5c29f1c35a5992fae214 and 644b3ecf926e3745d9119ace2acc971e94e2925a. --- diff --git a/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp b/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp index f15b1c0..145e42b 100644 --- a/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp +++ b/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp @@ -293,7 +293,7 @@ int CRPiCECAdapterCommunication::InitHostCEC(void) return VCHIQ_SUCCESS; } -bool CRPiCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs) /* = CEC_DEFAULT_CONNECT_TIMEOUT */, bool UNUSED(bSkipChecks) /* = false */, bool bStartListening) +bool CRPiCECAdapterCommunication::Open(uint32_t iTimeoutMs /* = CEC_DEFAULT_CONNECT_TIMEOUT */, bool UNUSED(bSkipChecks) /* = false */, bool bStartListening) { Close(); @@ -309,6 +309,14 @@ bool CRPiCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs) /* = CEC_DEFA vc_cec_register_callback(rpi_cec_callback, (void*)this); vc_tv_register_callback(rpi_tv_callback, (void*)this); + // release previous LA + vc_cec_release_logical_address(); + if (!m_logicalAddressCondition.Wait(m_mutex, m_bLogicalAddressChanged, iTimeoutMs)) + { + LIB_CEC->AddLog(CEC_LOG_ERROR, "failed to release the previous LA"); + return false; + } + // register LA "freeuse" if (RegisterLogicalAddress(CECDEVICE_FREEUSE)) {