diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs index 6365bd2940..9ad72d73f6 100644 --- a/Emby.Drawing/ImageProcessor.cs +++ b/Emby.Drawing/ImageProcessor.cs @@ -53,7 +53,11 @@ namespace Emby.Drawing private readonly IImageEncoder _imageEncoder; private readonly SemaphoreSlim _imageProcessingSemaphore; - public ImageProcessor(ILogger logger, IServerApplicationPaths appPaths, IFileSystem fileSystem, IJsonSerializer jsonSerializer, IImageEncoder imageEncoder) + public ImageProcessor(ILogger logger, + IServerApplicationPaths appPaths, + IFileSystem fileSystem, + IJsonSerializer jsonSerializer, + IImageEncoder imageEncoder) { _logger = logger; _fileSystem = fileSystem; diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 919fe07733..78dee4c448 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -159,10 +159,12 @@ namespace MediaBrowser.Api.Playback.Hls { var text = reader.ReadToEnd(); - var newDuration = "#EXT-X-TARGETDURATION:" + segmentLength.ToString(UsCulture) + Environment.NewLine + "#EXT-X-ALLOW-CACHE:NO"; + var newDuration = "#EXT-X-TARGETDURATION:" + segmentLength.ToString(UsCulture); // ffmpeg pads the reported length by a full second - return text.Replace("#EXT-X-TARGETDURATION:" + (segmentLength + 1).ToString(UsCulture), newDuration, StringComparison.OrdinalIgnoreCase); + text = text.Replace("#EXT-X-TARGETDURATION:" + (segmentLength + 1).ToString(UsCulture), newDuration, StringComparison.OrdinalIgnoreCase); + + return text; } } } diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index a55f54d3c8..4f938dc419 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -608,7 +608,6 @@ namespace MediaBrowser.Api.Playback.Hls builder.AppendLine("#EXT-X-VERSION:3"); builder.AppendLine("#EXT-X-TARGETDURATION:" + state.SegmentLength.ToString(UsCulture)); builder.AppendLine("#EXT-X-MEDIA-SEQUENCE:0"); - builder.AppendLine("#EXT-X-ALLOW-CACHE:NO"); var queryStringIndex = Request.RawUrl.IndexOf('?'); var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex); diff --git a/MediaBrowser.Dlna/DlnaManager.cs b/MediaBrowser.Dlna/DlnaManager.cs index f0f295c831..bdc8beb989 100644 --- a/MediaBrowser.Dlna/DlnaManager.cs +++ b/MediaBrowser.Dlna/DlnaManager.cs @@ -8,7 +8,6 @@ using MediaBrowser.Controller.Plugins; using MediaBrowser.Dlna.Profiles; using MediaBrowser.Dlna.Server; using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Serialization; diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj index 0cbe363982..adb096ec77 100644 --- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj +++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj @@ -77,6 +77,7 @@ + diff --git a/MediaBrowser.Model/Dlna/Profiles/DefaultProfile.cs b/MediaBrowser.Dlna/Profiles/DefaultProfile.cs similarity index 98% rename from MediaBrowser.Model/Dlna/Profiles/DefaultProfile.cs rename to MediaBrowser.Dlna/Profiles/DefaultProfile.cs index c9db9fbf85..a243fd0118 100644 --- a/MediaBrowser.Model/Dlna/Profiles/DefaultProfile.cs +++ b/MediaBrowser.Dlna/Profiles/DefaultProfile.cs @@ -1,6 +1,7 @@ -using System.Xml.Serialization; +using MediaBrowser.Model.Dlna; +using System.Xml.Serialization; -namespace MediaBrowser.Model.Dlna.Profiles +namespace MediaBrowser.Dlna.Profiles { [XmlRoot("Profile")] public class DefaultProfile : DeviceProfile diff --git a/MediaBrowser.Dlna/Profiles/DenonAvrProfile.cs b/MediaBrowser.Dlna/Profiles/DenonAvrProfile.cs index 224ae7715a..f8451bdfd8 100644 --- a/MediaBrowser.Dlna/Profiles/DenonAvrProfile.cs +++ b/MediaBrowser.Dlna/Profiles/DenonAvrProfile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/DirectTvProfile.cs b/MediaBrowser.Dlna/Profiles/DirectTvProfile.cs index 4c07c2827c..585f8652e6 100644 --- a/MediaBrowser.Dlna/Profiles/DirectTvProfile.cs +++ b/MediaBrowser.Dlna/Profiles/DirectTvProfile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs b/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs index ab887a3bff..bd7b42d5d2 100644 --- a/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs +++ b/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/Foobar2000Profile.cs b/MediaBrowser.Dlna/Profiles/Foobar2000Profile.cs index 1d011a2432..45cbbef6cb 100644 --- a/MediaBrowser.Dlna/Profiles/Foobar2000Profile.cs +++ b/MediaBrowser.Dlna/Profiles/Foobar2000Profile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/LgTvProfile.cs b/MediaBrowser.Dlna/Profiles/LgTvProfile.cs index 8b887500e3..4ecfd3c5b9 100644 --- a/MediaBrowser.Dlna/Profiles/LgTvProfile.cs +++ b/MediaBrowser.Dlna/Profiles/LgTvProfile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/LinksysDMA2100Profile.cs b/MediaBrowser.Dlna/Profiles/LinksysDMA2100Profile.cs index 0565f6c932..e7542ea9e5 100644 --- a/MediaBrowser.Dlna/Profiles/LinksysDMA2100Profile.cs +++ b/MediaBrowser.Dlna/Profiles/LinksysDMA2100Profile.cs @@ -1,7 +1,6 @@ using System.Xml.Serialization; using MediaBrowser.Controller.Dlna; using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/MediaMonkeyProfile.cs b/MediaBrowser.Dlna/Profiles/MediaMonkeyProfile.cs index a73c6ccf4b..7163252db2 100644 --- a/MediaBrowser.Dlna/Profiles/MediaMonkeyProfile.cs +++ b/MediaBrowser.Dlna/Profiles/MediaMonkeyProfile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs b/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs index 99dec2bc6c..9e51c2895c 100644 --- a/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs +++ b/MediaBrowser.Dlna/Profiles/PanasonicVieraProfile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs b/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs index 883af57d29..c98609393a 100644 --- a/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs +++ b/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; using System.Xml.Serialization; namespace MediaBrowser.Dlna.Profiles diff --git a/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs b/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs index 970995b7d9..396dd64892 100644 --- a/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs +++ b/MediaBrowser.Dlna/Profiles/SamsungSmartTvProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; using System.Xml.Serialization; namespace MediaBrowser.Dlna.Profiles diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs index ed325e3018..baaccba5a7 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; using System.Xml.Serialization; namespace MediaBrowser.Dlna.Profiles diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs index 6802bf6318..d2e6d7c15f 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs index 46549040f3..71f8772325 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs index d9891e87be..0b157ae336 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs index 85643bace6..0d974cbc0e 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs index 0f7151a840..ac4cb21312 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs b/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs index e92b0acfef..a99d7775aa 100644 --- a/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs b/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs index 553d77c7f7..a26c439113 100644 --- a/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs +++ b/MediaBrowser.Dlna/Profiles/WdtvLiveProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; using System.Xml.Serialization; namespace MediaBrowser.Dlna.Profiles diff --git a/MediaBrowser.Dlna/Profiles/Xbox360Profile.cs b/MediaBrowser.Dlna/Profiles/Xbox360Profile.cs index e3dd832248..62c06f8f57 100644 --- a/MediaBrowser.Dlna/Profiles/Xbox360Profile.cs +++ b/MediaBrowser.Dlna/Profiles/Xbox360Profile.cs @@ -1,6 +1,5 @@ using MediaBrowser.Model.Dlna; using System.Xml.Serialization; -using MediaBrowser.Model.Dlna.Profiles; namespace MediaBrowser.Dlna.Profiles { diff --git a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs index 3427d75f70..4c3b049bdd 100644 --- a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs +++ b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Dlna; -using MediaBrowser.Model.Dlna.Profiles; using System.Xml.Serialization; namespace MediaBrowser.Dlna.Profiles diff --git a/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs b/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs index 68602a381f..142fdf5fe1 100644 --- a/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs +++ b/MediaBrowser.Dlna/Ssdp/SsdpHandler.cs @@ -377,11 +377,11 @@ namespace MediaBrowser.Dlna.Ssdp } foreach (var d in RegisteredDevices) { - NotifyDevice(d, "alive"); + NotifyDevice(d, "alive", 1); } } - private void NotifyDevice(UpnpDevice dev, string type, int sendCount = 1) + private void NotifyDevice(UpnpDevice dev, string type, int sendCount) { const string header = "NOTIFY * HTTP/1.1"; diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 2ef1c0cbd4..2cd855e966 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -146,7 +146,44 @@ namespace MediaBrowser.MediaEncoding.Probing // string.Equals(stream.AspectRatio, "2.35:1", StringComparison.OrdinalIgnoreCase) || // string.Equals(stream.AspectRatio, "2.40:1", StringComparison.OrdinalIgnoreCase); - stream.IsAnamorphic = string.Equals(streamInfo.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase); + if (string.Equals(streamInfo.sample_aspect_ratio, "1:1", StringComparison.OrdinalIgnoreCase)) + { + stream.IsAnamorphic = false; + } + else if (!((string.IsNullOrWhiteSpace(streamInfo.sample_aspect_ratio) || string.Equals(streamInfo.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase)))) + { + stream.IsAnamorphic = true; + } + else if (string.IsNullOrWhiteSpace(streamInfo.display_aspect_ratio) || string.Equals(streamInfo.display_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase)) + { + stream.IsAnamorphic = false; + } + else + { + var ratioParts = streamInfo.display_aspect_ratio.Split(':'); + if (ratioParts.Length != 2) + { + stream.IsAnamorphic = false; + } + else + { + int ratio0; + int ratio1; + if (!Int32.TryParse(ratioParts[0], NumberStyles.Any, CultureInfo.InvariantCulture, out ratio0)) + { + stream.IsAnamorphic = false; + } + else if (!Int32.TryParse(ratioParts[1], NumberStyles.Any, CultureInfo.InvariantCulture, out ratio1)) + { + stream.IsAnamorphic = false; + } + else + { + stream.IsAnamorphic = ((streamInfo.width * ratio1) != (stream.Height * ratio0)); + } + } + } + } else { diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj index 87378fd5a7..f70fe628eb 100644 --- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj +++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj @@ -383,9 +383,6 @@ Dlna\ProfileConditionValue.cs - - Dlna\Profiles\DefaultProfile.cs - Dlna\ResolutionConfiguration.cs diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj index 61057e5bbb..bb8b096827 100644 --- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj +++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj @@ -348,9 +348,6 @@ Dlna\ProfileConditionValue.cs - - Dlna\Profiles\DefaultProfile.cs - Dlna\ResolutionConfiguration.cs diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index 8b9b2edf36..7297436a2e 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -111,6 +111,10 @@ namespace MediaBrowser.Model.Dlna XmlRootAttributes = new XmlAttribute[] { }; SupportedMediaTypes = "Audio,Photo,Video"; + MaxStreamingBitrate = 8000000; + MaxStaticBitrate = 8000000; + MusicStreamingTranscodingBitrate = 128000; + MusicSyncBitrate = 128000; } public List GetSupportedMediaTypes() diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index af0cbb1665..340bd94623 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -130,7 +130,6 @@ - diff --git a/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs index fa05973d87..06cbb93170 100644 --- a/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs +++ b/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs @@ -75,7 +75,10 @@ namespace MediaBrowser.Server.Implementations.EntryPoints private void Start() { _logger.Debug("Starting NAT discovery"); - + //NatUtility.EnabledProtocols = new List + //{ + // NatProtocol.Pmp + //}; NatUtility.DeviceFound += NatUtility_DeviceFound; // Mono.Nat does never rise this event. The event is there however it is useless. diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index 61432d00fb..98f063656c 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -435,7 +435,9 @@ namespace MediaBrowser.Server.Implementations.Persistence _shrinkMemoryTimer.Dispose(); _shrinkMemoryTimer = null; } - + + //_writeLock.Wait(); + if (_connection != null) { if (_connection.IsOpen()) diff --git a/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs b/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs index 0bc527ed56..6272fe9261 100644 --- a/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs +++ b/MediaBrowser.Server.Implementations/Sync/CloudSyncProfile.cs @@ -27,7 +27,7 @@ namespace MediaBrowser.Server.Implementations.Sync } var videoProfile = "high|main|baseline|constrained baseline"; - var videoLevel = "41"; + var videoLevel = "40"; DirectPlayProfiles = new[] {