+ bool bPowerUpEventReceived(true);
+
+ if (m_busDevice->GetLogicalAddress() != CECDEVICE_TV)
+ {
+ // get the status from the TV
+ CCECBusDevice *tv = m_processor->GetTV();
+ if (tv && tv->GetCurrentVendorId() == CEC_VENDOR_PANASONIC)
+ {
+ CVLCommandHandler *handler = static_cast<CVLCommandHandler *>(tv->GetHandler());
+ bPowerUpEventReceived = handler ? handler->PowerUpEventReceived() : false;
+ tv->MarkHandlerReady();
+ }
+ }
+ else
+ {
+ // get the current status
+ {
+ CLockObject lock(m_mutex);
+ bPowerUpEventReceived = m_iPowerUpEventReceived > 0 &&
+ GetTimeMs() - m_iPowerUpEventReceived > SOURCE_SWITCH_DELAY_MS;
+ }
+
+ // if we didn't receive the event, check if the TV is already marked as powered on
+ if (!bPowerUpEventReceived && m_busDevice->GetCurrentPowerStatus() == CEC_POWER_STATUS_ON)
+ {
+ CLockObject lock(m_mutex);
+ m_iPowerUpEventReceived = GetTimeMs();
+ bPowerUpEventReceived = true;
+ }
+ }
+
+ return bPowerUpEventReceived;
+}