mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +00:00
Revert "xbmc: After suspend wait for the first NIC to come up beforecontinuing"
This reverts commit 52bf3bf4db534900aa984ae7f8ca8cb569a45216. ... nah. keep old patch.
This commit is contained in:
parent
812be22883
commit
7d0bf986da
@ -1,66 +0,0 @@
|
|||||||
From 7cd450bb2b8ea18277efff955202bf3b36573898 Mon Sep 17 00:00:00 2001
|
|
||||||
From: verybadsoldier <vbs@springrts.de>
|
|
||||||
Date: Sun, 1 Sep 2013 17:10:19 +0200
|
|
||||||
Subject: [PATCH] After suspend wait for the first NIC to come up before
|
|
||||||
continuing
|
|
||||||
|
|
||||||
---
|
|
||||||
xbmc/powermanagement/PowerManager.cpp | 24 ++++++++++++++++++++++++
|
|
||||||
xbmc/powermanagement/PowerManager.h | 2 ++
|
|
||||||
2 files changed, 26 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/xbmc/powermanagement/PowerManager.cpp b/xbmc/powermanagement/PowerManager.cpp
|
|
||||||
index a68910b..8e93492 100644
|
|
||||||
--- a/xbmc/powermanagement/PowerManager.cpp
|
|
||||||
+++ b/xbmc/powermanagement/PowerManager.cpp
|
|
||||||
@@ -207,6 +207,8 @@ void CPowerManager::OnWake()
|
|
||||||
{
|
|
||||||
CLog::Log(LOGNOTICE, "%s: Running resume jobs", __FUNCTION__);
|
|
||||||
|
|
||||||
+ WaitForNic();
|
|
||||||
+
|
|
||||||
// reset out timers
|
|
||||||
g_application.ResetShutdownTimers();
|
|
||||||
|
|
||||||
@@ -254,3 +256,25 @@ void CPowerManager::OnLowBattery()
|
|
||||||
|
|
||||||
CAnnouncementManager::Announce(System, "xbmc", "OnLowBattery");
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+void CPowerManager::WaitForNic()
|
|
||||||
+{
|
|
||||||
+ CLog::Log(LOGDEBUG, "%s: Waithing for first NIC to come up", __FUNCTION__);
|
|
||||||
+
|
|
||||||
+ const unsigned maxLoopCount = 50u;
|
|
||||||
+ const unsigned sleepTimeMs = 200u;
|
|
||||||
+
|
|
||||||
+ for(unsigned i=0; i < maxLoopCount; ++i)
|
|
||||||
+ {
|
|
||||||
+ CNetworkInterface* pIface = g_application.getNetwork().GetFirstConnectedInterface();
|
|
||||||
+ if (pIface && pIface->IsEnabled() && pIface->IsConnected())
|
|
||||||
+ {
|
|
||||||
+ CLog::Log(LOGDEBUG, "%s: NIC is up after waiting %d ms", __FUNCTION__, i * sleepTimeMs);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ Sleep(sleepTimeMs);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ CLog::Log(LOGDEBUG, "%s: NIC did not come up within %d ms... Lets give up...", __FUNCTION__, maxLoopCount * sleepTimeMs);
|
|
||||||
+}
|
|
||||||
diff --git a/xbmc/powermanagement/PowerManager.h b/xbmc/powermanagement/PowerManager.h
|
|
||||||
index deb4b66..476cdc1 100644
|
|
||||||
--- a/xbmc/powermanagement/PowerManager.h
|
|
||||||
+++ b/xbmc/powermanagement/PowerManager.h
|
|
||||||
@@ -73,6 +73,8 @@ class CPowerManager : public IPowerEventsCallback
|
|
||||||
|
|
||||||
void OnLowBattery();
|
|
||||||
|
|
||||||
+ void WaitForNic();
|
|
||||||
+
|
|
||||||
IPowerSyscall *m_instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
--
|
|
||||||
1.8.4
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user