From: Lars Op den Kamp Date: Fri, 27 Apr 2012 16:44:00 +0000 (+0200) Subject: cec: don't exit libCEC if the physical address couldn't be set when initialising... X-Git-Tag: upstream/2.2.0~1^2~29^2^2~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=21b8a4e9e826d33b8dedab02bf9420451a65196e;p=deb_libcec.git cec: don't exit libCEC if the physical address couldn't be set when initialising, but revert to the default physical address and display a warning instead --- diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index be14a0b..c37bed2 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -280,7 +280,10 @@ bool CCECProcessor::Initialise(void) CLibCEC::AddLog(CEC_LOG_ERROR, "unable to set the physical address to %4x", m_configuration.iPhysicalAddress); } else if (m_configuration.iPhysicalAddress == 0 && (bReturn = SetHDMIPort(m_configuration.baseDevice, m_configuration.iHDMIPort, true)) == false) + { CLibCEC::AddLog(CEC_LOG_ERROR, "unable to set HDMI port %d on %s (%x)", m_configuration.iHDMIPort, ToString(m_configuration.baseDevice), (uint8_t)m_configuration.baseDevice); + bReturn = true; + } if (bReturn && m_configuration.bActivateSource == 1) m_busDevices[m_configuration.logicalAddresses.primary]->ActivateSource(); @@ -643,9 +646,12 @@ bool CCECProcessor::SetHDMIPort(cec_logical_address iBaseDevice, uint8_t iPort, } if (!bReturn) - CLibCEC::AddLog(CEC_LOG_ERROR, "failed to set the physical address"); - else - SetPhysicalAddress(iPhysicalAddress); + { + CLibCEC::AddLog(CEC_LOG_WARNING, "failed to set the physical address to %04X, setting it to the default value %04X", iPhysicalAddress, CEC_DEFAULT_PHYSICAL_ADDRESS); + iPhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS; + } + + SetPhysicalAddress(iPhysicalAddress); return bReturn; }