X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=0678ce393ef8dfe3a1825e8904940af6a9de6b12;hb=c02980af7d1e94a8f1de4df4572a551bb796bd5f;hp=07d944eb32eefc0083d8356441f7ade4e9a6bac5;hpb=8acf4aac0ff1e3ac094290dbb9537c4aefb86e3d;p=deb_libcec.git diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 07d944e..0678ce3 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) @@ -209,8 +212,8 @@ void CCECBusDevice::PollVendorId(void) cec_command command; cec_command::format(command, GetMyLogicalAddress(), GetLogicalAddress(), CEC_OPCODE_GIVE_DEVICE_VENDOR_ID); - command.ack_timeout = 0; - m_processor->Transmit(command); + if (m_processor->Transmit(command)) + m_condition.Wait(&m_mutex, 1000); } }