From: Lars Op den Kamp Date: Sun, 30 Oct 2011 20:32:38 +0000 (+0100) Subject: cec: only log new power status when it actually changed X-Git-Tag: upstream/2.2.0~1^2~157 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b0271d54fb85344542dc86affbbf36b11e02cb6b;p=deb_libcec.git cec: only log new power status when it actually changed --- diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 07d944e..cbd332e 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -117,10 +117,13 @@ void CCECBusDevice::SetCecVersion(const cec_version newVersion) void CCECBusDevice::SetPowerStatus(const cec_power_status powerStatus) { - CStdString strLog; - strLog.Format("device %d power status changed from %2x to %2x", m_iLogicalAddress, m_powerStatus, powerStatus); - m_processor->AddLog(CEC_LOG_DEBUG, strLog); - m_powerStatus = powerStatus; + if (m_powerStatus != powerStatus) + { + CStdString strLog; + strLog.Format("device %d power status changed from %2x to %2x", m_iLogicalAddress, m_powerStatus, powerStatus); + m_processor->AddLog(CEC_LOG_DEBUG, strLog); + m_powerStatus = powerStatus; + } } void CCECBusDevice::SetVendorId(const cec_datapacket &data)