fixed - deleted a couple of lines too many in 045b2e29de7d187e8586fa3f6b59b9c6470efd31
[deb_libcec.git] / src / lib / implementations / CECCommandHandler.cpp
index 8fc844fca9a4629055bf947d3dbfc96db2889c41..f20f6af9c063d2b4dd66e4909aa49ceade9e3bf6 100644 (file)
@@ -1152,6 +1152,9 @@ bool CCECCommandHandler::ActivateSource(bool bTransmitDelayedCommandsOnly /* = f
     if (bActiveSourceFailed || !bSourceSwitchAllowed)
     {
       LIB_CEC->AddLog(CEC_LOG_DEBUG, "failed to make '%s' the active source. will retry later", m_busDevice->GetLogicalAddressName());
+      CLockObject lock(m_mutex);
+      if (m_iActiveSourcePending == 0)
+        m_iActiveSourcePending = GetTimeMs() + (int64_t)CEC_ACTIVE_SOURCE_SWITCH_RETRY_TIME_MS;
       return false;
     }
     else