diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs index 35a9bd8aa1..071c40c29e 100644 --- a/Emby.Drawing.Skia/SkiaEncoder.cs +++ b/Emby.Drawing.Skia/SkiaEncoder.cs @@ -183,8 +183,8 @@ namespace Emby.Drawing.Skia } } - private string[] TransparentImageTypes = new string[] { ".png", ".gif", ".webp" }; - private SKBitmap Decode(string path, bool forceCleanBitmap, out SKCodecOrigin origin) + private static string[] TransparentImageTypes = new string[] { ".png", ".gif", ".webp" }; + internal static SKBitmap Decode(string path, bool forceCleanBitmap, out SKCodecOrigin origin) { var requiresTransparencyHack = TransparentImageTypes.Contains(Path.GetExtension(path) ?? string.Empty); diff --git a/Emby.Drawing.Skia/StripCollageBuilder.cs b/Emby.Drawing.Skia/StripCollageBuilder.cs index 605677aaba..624245ee79 100644 --- a/Emby.Drawing.Skia/StripCollageBuilder.cs +++ b/Emby.Drawing.Skia/StripCollageBuilder.cs @@ -82,7 +82,8 @@ namespace Emby.Drawing.Skia for (int i = 0; i < 4; i++) { - using (var currentBitmap = SKBitmap.Decode(paths[imageIndex])) + SKCodecOrigin origin; + using (var currentBitmap = SkiaEncoder.Decode(paths[imageIndex], false, out origin)) { // resize to the same aspect as the original int iWidth = (int)Math.Abs(iHeight * currentBitmap.Width / currentBitmap.Height); @@ -163,7 +164,8 @@ namespace Emby.Drawing.Skia { for (var y = 0; y < 2; y++) { - using (var currentBitmap = SKBitmap.Decode(paths[imageIndex])) + SKCodecOrigin origin; + using (var currentBitmap = SkiaEncoder.Decode(paths[imageIndex], false, out origin)) { using (var resizedBitmap = new SKBitmap(cellWidth, cellHeight, currentBitmap.ColorType, currentBitmap.AlphaType)) { diff --git a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs index 98011ddd48..7be4101c80 100644 --- a/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs +++ b/Emby.Server.Implementations/Channels/ChannelDynamicMediaSourceProvider.cs @@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Channels return Task.FromResult>(new List()); } - public Task> OpenMediaSource(string openToken, CancellationToken cancellationToken) + public Task> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken) { throw new NotImplementedException(); } diff --git a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs index df8d1ac451..f43e45441c 100644 --- a/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs +++ b/Emby.Server.Implementations/Data/CleanDatabaseScheduledTask.cs @@ -17,7 +17,7 @@ using MediaBrowser.Model.Tasks; namespace Emby.Server.Implementations.Data { - public class CleanDatabaseScheduledTask : IScheduledTask + public class CleanDatabaseScheduledTask : ILibraryPostScanTask { private readonly ILibraryManager _libraryManager; private readonly IItemRepository _itemRepo; @@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.Data get { return "Library"; } } - public async Task Execute(CancellationToken cancellationToken, IProgress progress) + public async Task Run(IProgress progress, CancellationToken cancellationToken) { // Ensure these objects are lazy loaded. // Without this there is a deadlock that will need to be investigated diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 5486f404f3..0e6b9b8f11 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -307,7 +307,7 @@ - ..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll + ..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll True diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs index 4857008f35..e4bc2962b2 100644 --- a/Emby.Server.Implementations/Library/MediaSourceManager.cs +++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs @@ -371,7 +371,7 @@ namespace Emby.Server.Implementations.Library var tuple = GetProvider(request.OpenToken); var provider = tuple.Item1; - var mediaSourceTuple = await provider.OpenMediaSource(tuple.Item2, cancellationToken).ConfigureAwait(false); + var mediaSourceTuple = await provider.OpenMediaSource(tuple.Item2, request.AllowMediaProbe, cancellationToken).ConfigureAwait(false); var mediaSource = mediaSourceTuple.Item1; diff --git a/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs b/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs index 428b6202b4..143350a8b7 100644 --- a/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs +++ b/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs @@ -16,8 +16,8 @@ namespace Emby.Server.Implementations.LiveTv private readonly IMediaEncoder _mediaEncoder; private readonly ILogger _logger; - const int ProbeAnalyzeDurationMs = 2000; - const int PlaybackAnalyzeDurationMs = 2000; + const int ProbeAnalyzeDurationMs = 3000; + const int PlaybackAnalyzeDurationMs = 3000; public LiveStreamHelper(IMediaEncoder mediaEncoder, ILogger logger) { diff --git a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs index 0329ea6066..919c0f10d6 100644 --- a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs +++ b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs @@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.LiveTv return list; } - public async Task> OpenMediaSource(string openToken, CancellationToken cancellationToken) + public async Task> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken) { MediaSourceInfo stream = null; const bool isAudio = false; @@ -140,7 +140,7 @@ namespace Emby.Server.Implementations.LiveTv try { - if (!stream.SupportsProbing || stream.MediaStreams.Any(i => i.Index != -1)) + if (!allowLiveStreamProbe || !stream.SupportsProbing || stream.MediaStreams.Any(i => i.Index != -1)) { AddMediaInfo(stream, isAudio, cancellationToken); } diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config index 468bf925fd..03336c936a 100644 --- a/Emby.Server.Implementations/packages.config +++ b/Emby.Server.Implementations/packages.config @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index 6853ddbebf..ae7271844d 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -134,7 +134,7 @@ namespace MediaBrowser.Api.Playback SetDeviceSpecificData(item, result.MediaSource, profile, authInfo, request.MaxStreamingBitrate, request.StartTimeTicks ?? 0, result.MediaSource.Id, request.AudioStreamIndex, - request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, true, true, true); + request.SubtitleStreamIndex, request.MaxAudioChannels, request.PlaySessionId, request.UserId, request.EnableDirectPlay, true, request.EnableDirectStream, true, true, true); } else { @@ -176,7 +176,7 @@ namespace MediaBrowser.Api.Playback { var mediaSourceId = request.MediaSourceId; - SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, request.ForceDirectPlayRemoteMediaSource, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy); + SetDeviceSpecificData(request.Id, info, profile, authInfo, request.MaxStreamingBitrate ?? profile.MaxStreamingBitrate, request.StartTimeTicks ?? 0, mediaSourceId, request.AudioStreamIndex, request.SubtitleStreamIndex, request.MaxAudioChannels, request.UserId, request.EnableDirectPlay, true, request.EnableDirectStream, request.EnableTranscoding, request.AllowVideoStreamCopy, request.AllowAudioStreamCopy); } if (request.AutoOpenLiveStream) @@ -191,7 +191,6 @@ namespace MediaBrowser.Api.Playback DeviceProfile = request.DeviceProfile, EnableDirectPlay = request.EnableDirectPlay, EnableDirectStream = request.EnableDirectStream, - ForceDirectPlayRemoteMediaSource = request.ForceDirectPlayRemoteMediaSource, ItemId = request.Id, MaxAudioChannels = request.MaxAudioChannels, MaxStreamingBitrate = request.MaxStreamingBitrate, @@ -199,7 +198,8 @@ namespace MediaBrowser.Api.Playback StartTimeTicks = request.StartTimeTicks, SubtitleStreamIndex = request.SubtitleStreamIndex, UserId = request.UserId, - OpenToken = mediaSource.OpenToken + OpenToken = mediaSource.OpenToken, + AllowMediaProbe = request.AllowMediaProbe }).ConfigureAwait(false); diff --git a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs index b0881ba7c4..4ec9adf4e1 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceProvider.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceProvider.cs @@ -20,10 +20,7 @@ namespace MediaBrowser.Controller.Library /// /// Opens the media source. /// - /// The open token. - /// The cancellation token. - /// Task<MediaSourceInfo>. - Task> OpenMediaSource(string openToken, CancellationToken cancellationToken); + Task> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken); /// /// Closes the media source. diff --git a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs index 025f1bc7a6..3033400308 100644 --- a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs +++ b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs @@ -17,13 +17,13 @@ namespace MediaBrowser.Model.MediaInfo public bool EnableDirectPlay { get; set; } public bool EnableDirectStream { get; set; } - public bool ForceDirectPlayRemoteMediaSource { get; set; } + public bool AllowMediaProbe { get; set; } public LiveStreamRequest() { - ForceDirectPlayRemoteMediaSource = true; EnableDirectPlay = true; EnableDirectStream = true; + AllowMediaProbe = true; } public LiveStreamRequest(AudioOptions options) diff --git a/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs index 1843fb69aa..afffe9b145 100644 --- a/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs +++ b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs @@ -27,19 +27,19 @@ namespace MediaBrowser.Model.MediaInfo public bool EnableDirectPlay { get; set; } public bool EnableDirectStream { get; set; } public bool EnableTranscoding { get; set; } - public bool ForceDirectPlayRemoteMediaSource { get; set; } public bool AllowVideoStreamCopy { get; set; } public bool AllowAudioStreamCopy { get; set; } public bool AutoOpenLiveStream { get; set; } + public bool AllowMediaProbe { get; set; } public PlaybackInfoRequest() { - ForceDirectPlayRemoteMediaSource = true; EnableDirectPlay = true; EnableDirectStream = true; EnableTranscoding = true; AllowVideoStreamCopy = true; AllowAudioStreamCopy = true; + AllowMediaProbe = true; } } } diff --git a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj index be928319f6..df98c65847 100644 --- a/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj +++ b/MediaBrowser.Server.Mono/MediaBrowser.Server.Mono.csproj @@ -71,11 +71,11 @@ True - ..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll + ..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll True - ..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.6\lib\net45\SQLitePCLRaw.provider.sqlite3.dll + ..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.7\lib\net45\SQLitePCLRaw.provider.sqlite3.dll True diff --git a/MediaBrowser.Server.Mono/packages.config b/MediaBrowser.Server.Mono/packages.config index f1de00589b..dcc477e9a2 100644 --- a/MediaBrowser.Server.Mono/packages.config +++ b/MediaBrowser.Server.Mono/packages.config @@ -6,6 +6,6 @@ - - + + \ No newline at end of file diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.cs index 6b100b86d9..bc38476ca4 100644 --- a/MediaBrowser.ServerApplication/MainStartup.cs +++ b/MediaBrowser.ServerApplication/MainStartup.cs @@ -678,7 +678,7 @@ namespace MediaBrowser.ServerApplication _logger.Info("Calling Application.Exit"); //Application.Exit(); - + Environment.Exit(0); } @@ -770,19 +770,43 @@ namespace MediaBrowser.ServerApplication try { - var subkey = Environment.Is64BitProcess - ? "SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64" - : "SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x86"; + RegistryKey key; - using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default) - .OpenSubKey(subkey)) + if (Environment.Is64BitProcess) { - if (ndpKey != null && ndpKey.GetValue("Version") != null) + key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default) + .OpenSubKey("SOFTWARE\\Classes\\Installer\\Dependencies\\{d992c12e-cab2-426f-bde3-fb8c53950b0d}"); + + if (key == null) { - var installedVersion = ((string)ndpKey.GetValue("Version")).TrimStart('v'); - if (installedVersion.StartsWith("14", StringComparison.OrdinalIgnoreCase)) + key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default) + .OpenSubKey("SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x64"); + } + } + else + { + key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default) + .OpenSubKey("SOFTWARE\\Classes\\Installer\\Dependencies\\{e2803110-78b3-4664-a479-3611a381656a}"); + + if (key == null) + { + key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default) + .OpenSubKey("SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\x86"); + } + } + + if (key != null) + { + using (key) + { + var version = key.GetValue("Version"); + if (version != null) { - return; + var installedVersion = ((string)version).TrimStart('v'); + if (installedVersion.StartsWith("14", StringComparison.OrdinalIgnoreCase)) + { + return; + } } } } diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index e918e0883f..591ac0fba0 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -92,11 +92,11 @@ ..\packages\SkiaSharp.1.58.0\lib\net45\SkiaSharp.dll - ..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll + ..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll True - ..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.6\lib\net45\SQLitePCLRaw.provider.sqlite3.dll + ..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.7\lib\net45\SQLitePCLRaw.provider.sqlite3.dll True diff --git a/MediaBrowser.ServerApplication/packages.config b/MediaBrowser.ServerApplication/packages.config index 2b0d503a47..0fa93db828 100644 --- a/MediaBrowser.ServerApplication/packages.config +++ b/MediaBrowser.ServerApplication/packages.config @@ -5,6 +5,6 @@ - - + + \ No newline at end of file diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index ff58c13ac9..cb4d372a52 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Common - 3.0.704 + 3.0.705 Emby.Common Emby Team ebr,Luke,scottisafool diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index a5707a2654..76846b98c2 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ MediaBrowser.Server.Core - 3.0.704 + 3.0.705 Emby.Server.Core Emby Team ebr,Luke,scottisafool @@ -12,7 +12,7 @@ Contains core components required to build plugins for Emby Server. Copyright © Emby 2013 - + diff --git a/SharedVersion.cs b/SharedVersion.cs index 2c78642a6b..ba86598038 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.22.1")] +[assembly: AssemblyVersion("3.2.22.2")]