+ if (PhysicalAddressInUse(iPhysicalAddress))
+ {
+ strLog.Format("physical address %4x is in use", iPhysicalAddress);
+ AddLog(CEC_LOG_DEBUG, strLog);
+ iPos = (iPos == 1) ? 0 : iPos / 0x10;
+ }
+ else
+ {
+ strLog.Format("physical address %4x is free", iPhysicalAddress);
+ AddLog(CEC_LOG_DEBUG, strLog);
+ SetPhysicalAddress(iPhysicalAddress);
+ bReturn = true;
+ }