aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna
diff options
context:
space:
mode:
authorVasily <JustAMan@users.noreply.github.com>2019-02-27 19:23:31 +0300
committerGitHub <noreply@github.com>2019-02-27 19:23:31 +0300
commit3769453541d8e3da45a9bf40ef0e9da6268bebdc (patch)
tree36b4c42a65b666536f34cd9f8da6b6e54b8a8fc8 /Emby.Dlna
parent8c2af50170ea2a7964a6ad40bbe60026cfa625b0 (diff)
parent7429c07c05ad12fbacef7952574edd75c294eb8a (diff)
Merge pull request #978 from fasheng/fix-dlna-multiple-interfaces
Fix DLNA for multiple interfaces on linux
Diffstat (limited to 'Emby.Dlna')
-rw-r--r--Emby.Dlna/Configuration/DlnaOptions.cs2
-rw-r--r--Emby.Dlna/Main/DlnaEntryPoint.cs19
2 files changed, 13 insertions, 8 deletions
diff --git a/Emby.Dlna/Configuration/DlnaOptions.cs b/Emby.Dlna/Configuration/DlnaOptions.cs
index 0ebb490a1f..c7cb364a83 100644
--- a/Emby.Dlna/Configuration/DlnaOptions.cs
+++ b/Emby.Dlna/Configuration/DlnaOptions.cs
@@ -7,6 +7,7 @@ namespace Emby.Dlna.Configuration
public bool EnableServer { get; set; }
public bool EnableDebugLog { get; set; }
public bool BlastAliveMessages { get; set; }
+ public bool SendOnlyMatchedHost { get; set; }
public int ClientDiscoveryIntervalSeconds { get; set; }
public int BlastAliveMessageIntervalSeconds { get; set; }
public string DefaultUserId { get; set; }
@@ -16,6 +17,7 @@ namespace Emby.Dlna.Configuration
EnablePlayTo = true;
EnableServer = true;
BlastAliveMessages = true;
+ SendOnlyMatchedHost = true;
ClientDiscoveryIntervalSeconds = 60;
BlastAliveMessageIntervalSeconds = 1800;
}
diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs
index a200065782..5a7c9b617e 100644
--- a/Emby.Dlna/Main/DlnaEntryPoint.cs
+++ b/Emby.Dlna/Main/DlnaEntryPoint.cs
@@ -169,9 +169,10 @@ namespace Emby.Dlna.Main
{
if (_communicationsServer == null)
{
- var enableMultiSocketBinding = _environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows;
+ var enableMultiSocketBinding = _environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Windows ||
+ _environmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Linux;
- _communicationsServer = new SsdpCommunicationsServer(_socketFactory, _networkManager, _logger, enableMultiSocketBinding)
+ _communicationsServer = new SsdpCommunicationsServer(_config, _socketFactory, _networkManager, _logger, enableMultiSocketBinding)
{
IsShared = true
};
@@ -229,7 +230,7 @@ namespace Emby.Dlna.Main
try
{
- _Publisher = new SsdpDevicePublisher(_communicationsServer, _environmentInfo.OperatingSystemName, _environmentInfo.OperatingSystemVersion);
+ _Publisher = new SsdpDevicePublisher(_communicationsServer, _networkManager, _environmentInfo.OperatingSystemName, _environmentInfo.OperatingSystemVersion, _config.GetDlnaConfiguration().SendOnlyMatchedHost);
_Publisher.LogFunction = LogMessage;
_Publisher.SupportPnpRootDevice = false;
@@ -251,11 +252,11 @@ namespace Emby.Dlna.Main
foreach (var address in addresses)
{
- // TODO: Remove this condition on platforms that support it
- //if (address.AddressFamily == IpAddressFamily.InterNetworkV6)
- //{
- // continue;
- //}
+ if (address.AddressFamily == IpAddressFamily.InterNetworkV6)
+ {
+ // Not support IPv6 right now
+ continue;
+ }
var fullService = "urn:schemas-upnp-org:device:MediaServer:1";
@@ -268,6 +269,8 @@ namespace Emby.Dlna.Main
{
CacheLifetime = TimeSpan.FromSeconds(1800), //How long SSDP clients can cache this info.
Location = uri, // Must point to the URL that serves your devices UPnP description document.
+ Address = address,
+ SubnetMask = _networkManager.GetLocalIpSubnetMask(address),
FriendlyName = "Jellyfin",
Manufacturer = "Jellyfin",
ModelName = "Jellyfin Server",