X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=7fe92a451236ec893e89ef47fd213e5ae164fb56;hb=1b2120236aca8246e1c5fba371db99e5da3d3f0e;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; }