X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=7fe92a451236ec893e89ef47fd213e5ae164fb56;hb=61742d42b79639e3fbf0aafa43f437d9a1c149e9;hp=439fc05fbf01d27b677eab7f7828f8fabb98bec4;hpb=03ae897d74d37f6fdb35e2bb937e851cee61793b;p=deb_libcec.git diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 439fc05..7fe92a4 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -99,7 +99,16 @@ bool CCECBusDevice::PowerOn(void) cec_command::Format(command, GetMyLogicalAddress(), m_iLogicalAddress, CEC_OPCODE_IMAGE_VIEW_ON); if (m_processor->Transmit(command)) { - RequestPowerStatus(); + { + CLockObject lock(&m_mutex); + m_powerStatus = CEC_POWER_STATUS_UNKNOWN; + } + cec_power_status status = GetPowerStatus(); + if (status == CEC_POWER_STATUS_STANDBY || status == CEC_POWER_STATUS_UNKNOWN) + { + SendKeypress(CEC_USER_CONTROL_CODE_POWER, true); + return SendKeyRelease(false); + } return true; }