Merge pull request #2742 from MediaBrowser/dev

Dev
pull/1154/head
Luke 7 years ago committed by GitHub
commit d199052e10

@ -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);

@ -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))
{

@ -30,7 +30,7 @@ namespace Emby.Server.Implementations.Channels
return Task.FromResult<IEnumerable<MediaSourceInfo>>(new List<MediaSourceInfo>());
}
public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken)
public Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}

@ -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<double> progress)
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{
// Ensure these objects are lazy loaded.
// Without this there is a deadlock that will need to be investigated

@ -307,7 +307,7 @@
</ItemGroup>
<ItemGroup>
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<HintPath>..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

@ -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;

@ -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)
{

@ -118,7 +118,7 @@ namespace Emby.Server.Implementations.LiveTv
return list;
}
public async Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken)
public async Task<Tuple<MediaSourceInfo, IDirectStreamProvider>> 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);
}

@ -3,5 +3,5 @@
<package id="Emby.XmlTv" version="1.0.9" targetFramework="net46" />
<package id="MediaBrowser.Naming" version="1.0.5" targetFramework="portable45-net45+win8" />
<package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" />
<package id="SQLitePCLRaw.core" version="1.1.6" targetFramework="net46" />
<package id="SQLitePCLRaw.core" version="1.1.7" targetFramework="net46" />
</packages>

@ -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);

@ -20,10 +20,7 @@ namespace MediaBrowser.Controller.Library
/// <summary>
/// Opens the media source.
/// </summary>
/// <param name="openToken">The open token.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;MediaSourceInfo&gt;.</returns>
Task<Tuple<MediaSourceInfo,IDirectStreamProvider>> OpenMediaSource(string openToken, CancellationToken cancellationToken);
Task<Tuple<MediaSourceInfo,IDirectStreamProvider>> OpenMediaSource(string openToken, bool allowLiveStreamProbe, CancellationToken cancellationToken);
/// <summary>
/// Closes the media source.

@ -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)

@ -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;
}
}
}

@ -71,11 +71,11 @@
<Private>True</Private>
</Reference>
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<HintPath>..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLitePCLRaw.provider.sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62684c7b4f184e3f, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.6\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
<HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.7\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

@ -6,6 +6,6 @@
<package id="SharpCompress" version="0.14.0" targetFramework="net46" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net46" />
<package id="SkiaSharp" version="1.58.0" targetFramework="net46" />
<package id="SQLitePCLRaw.core" version="1.1.6" targetFramework="net46" />
<package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.6" targetFramework="net46" />
<package id="SQLitePCLRaw.core" version="1.1.7" targetFramework="net46" />
<package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.7" targetFramework="net46" />
</packages>

@ -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;
}
}
}
}

@ -92,11 +92,11 @@
<HintPath>..\packages\SkiaSharp.1.58.0\lib\net45\SkiaSharp.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.1.1.6\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<HintPath>..\packages\SQLitePCLRaw.core.1.1.7\lib\net45\SQLitePCLRaw.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="SQLitePCLRaw.provider.sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=62684c7b4f184e3f, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.6\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
<HintPath>..\packages\SQLitePCLRaw.provider.sqlite3.net45.1.1.7\lib\net45\SQLitePCLRaw.provider.sqlite3.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

@ -5,6 +5,6 @@
<package id="SharpCompress" version="0.14.0" targetFramework="net462" />
<package id="SimpleInjector" version="4.0.8" targetFramework="net462" />
<package id="SkiaSharp" version="1.58.0" targetFramework="net462" />
<package id="SQLitePCLRaw.core" version="1.1.6" targetFramework="net462" />
<package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.6" targetFramework="net462" />
<package id="SQLitePCLRaw.core" version="1.1.7" targetFramework="net462" />
<package id="SQLitePCLRaw.provider.sqlite3.net45" version="1.1.7" targetFramework="net462" />
</packages>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MediaBrowser.Common</id>
<version>3.0.704</version>
<version>3.0.705</version>
<title>Emby.Common</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>MediaBrowser.Server.Core</id>
<version>3.0.704</version>
<version>3.0.705</version>
<title>Emby.Server.Core</title>
<authors>Emby Team</authors>
<owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Emby Server.</description>
<copyright>Copyright © Emby 2013</copyright>
<dependencies>
<dependency id="MediaBrowser.Common" version="3.0.704" />
<dependency id="MediaBrowser.Common" version="3.0.705" />
</dependencies>
</metadata>
<files>

@ -1,3 +1,3 @@
using System.Reflection;
[assembly: AssemblyVersion("3.2.22.1")]
[assembly: AssemblyVersion("3.2.22.2")]

Loading…
Cancel
Save