X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECClient.cpp;h=ae0b9f6e0c7408c5a73758c43db5d37cfc5cc08a;hb=0a61dc2416f3eacb839ff67ac5abf0024c1d2f40;hp=5b4529788487f19305da14379242bb5e4fcd82fd;hpb=80a43fba8d6f530fdf9e178c1d158cadd60e6c5d;p=deb_libcec.git diff --git a/src/lib/CECClient.cpp b/src/lib/CECClient.cpp index 5b45297..ae0b9f6 100644 --- a/src/lib/CECClient.cpp +++ b/src/lib/CECClient.cpp @@ -33,6 +33,7 @@ #include "CECClient.h" #include "CECProcessor.h" #include "LibCEC.h" +#include "CECTypeUtils.h" #include "devices/CECPlaybackDevice.h" #include "devices/CECAudioSystem.h" #include "devices/CECTV.h" @@ -41,7 +42,7 @@ using namespace CEC; using namespace PLATFORM; #define LIB_CEC m_processor->GetLib() -#define ToString(x) LIB_CEC->ToString(x) +#define ToString(x) CCECTypeUtils::ToString(x) CCECClient::CCECClient(CCECProcessor *processor, const libcec_configuration &configuration) : m_processor(processor), @@ -194,15 +195,19 @@ void CCECClient::ResetPhysicalAddress(void) void CCECClient::SetPhysicalAddress(const libcec_configuration &configuration) { - // try to autodetect the address bool bPASet(false); - if (m_processor->CECInitialised() && configuration.bAutodetectAddress == 1) - bPASet = AutodetectPhysicalAddress(); - // try to use physical address setting + // override the physical address from configuration.iPhysicalAddress if it's set if (!bPASet && CLibCEC::IsValidPhysicalAddress(configuration.iPhysicalAddress)) bPASet = SetPhysicalAddress(configuration.iPhysicalAddress); + // try to autodetect the address + if (!bPASet && m_processor->CECInitialised()) + { + bPASet = AutodetectPhysicalAddress(); + m_configuration.bAutodetectAddress = bPASet ? 1 : 0; + } + // use the base device + hdmi port settings if (!bPASet) bPASet = SetHDMIPort(configuration.baseDevice, configuration.iHDMIPort);