cec: don't set the physical address to 0
authorLars Op den Kamp <lars@opdenkamp.eu>
Sun, 30 Oct 2011 14:28:39 +0000 (15:28 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sun, 30 Oct 2011 14:28:39 +0000 (15:28 +0100)
src/lib/devices/CECBusDevice.cpp

index c798ded339e365fb1dc2f094fc1e674487144cdd..dc9e62076b028bc964108d7085d6bce03a53b3b5 100644 (file)
@@ -216,11 +216,14 @@ void CCECBusDevice::PollVendorId(void)
 
 void CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress, uint16_t iOldAddress /* = 0 */)
 {
-  CStdString strLog;
-  strLog.Format(">> %i changed physical address from %04x to %04x", GetLogicalAddress(), m_iPhysicalAddress, iNewAddress);
-  AddLog(CEC_LOG_DEBUG, strLog.c_str());
+  if (iNewAddress > 0)
+  {
+    CStdString strLog;
+    strLog.Format(">> %i changed physical address from %04x to %04x", GetLogicalAddress(), m_iPhysicalAddress, iNewAddress);
+    AddLog(CEC_LOG_DEBUG, strLog.c_str());
 
-  m_iPhysicalAddress = iNewAddress;
+    m_iPhysicalAddress = iNewAddress;
+  }
 }
 
 bool CCECBusDevice::PowerOn(void)