mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
fixes #1218 - Dlna server doesn't work after resuming to sleep
This commit is contained in:
parent
02b828a0e2
commit
3eda14eff0
1 changed files with 11 additions and 0 deletions
|
@ -15,6 +15,7 @@ using System.Net.Sockets;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace MediaBrowser.Dlna.Ssdp
|
namespace MediaBrowser.Dlna.Ssdp
|
||||||
{
|
{
|
||||||
|
@ -121,6 +122,15 @@ namespace MediaBrowser.Dlna.Ssdp
|
||||||
RestartSocketListener();
|
RestartSocketListener();
|
||||||
|
|
||||||
ReloadAliveNotifier();
|
ReloadAliveNotifier();
|
||||||
|
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Mode == PowerModes.Resume)
|
||||||
|
{
|
||||||
|
NotifyAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendSearchMessage(EndPoint localIp)
|
public void SendSearchMessage(EndPoint localIp)
|
||||||
|
@ -433,6 +443,7 @@ namespace MediaBrowser.Dlna.Ssdp
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
_config.NamedConfigurationUpdated -= _config_ConfigurationUpdated;
|
_config.NamedConfigurationUpdated -= _config_ConfigurationUpdated;
|
||||||
|
SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged;
|
||||||
|
|
||||||
_isDisposed = true;
|
_isDisposed = true;
|
||||||
while (_messageQueue.Count != 0)
|
while (_messageQueue.Count != 0)
|
||||||
|
|
Loading…
Reference in a new issue