mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-18 08:06:35 +00:00
add error handling to work around skia crashes
This commit is contained in:
@@ -7,6 +7,7 @@ using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Globalization;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common
|
||||
{
|
||||
@@ -17,11 +18,12 @@ namespace MediaBrowser.Server.Startup.Common
|
||||
IFileSystem fileSystem,
|
||||
StartupOptions startupOptions,
|
||||
Func<IHttpClient> httpClient,
|
||||
IApplicationPaths appPaths)
|
||||
IApplicationPaths appPaths,
|
||||
ILocalizationManager localizationManager)
|
||||
{
|
||||
try
|
||||
{
|
||||
return new SkiaEncoder(logManager.GetLogger("Skia"), appPaths, httpClient, fileSystem);
|
||||
return new SkiaEncoder(logManager.GetLogger("Skia"), appPaths, httpClient, fileSystem, localizationManager);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -304,6 +304,19 @@ namespace MediaBrowser.ServerApplication
|
||||
}
|
||||
}
|
||||
|
||||
private static string UpdatePackageFileName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Environment.Is64BitOperatingSystem)
|
||||
{
|
||||
return "embyserver-win-x64-{version}.zip";
|
||||
}
|
||||
|
||||
return "embyserver-win-x86-{version}.zip";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the application.
|
||||
/// </summary>
|
||||
@@ -324,7 +337,7 @@ namespace MediaBrowser.ServerApplication
|
||||
options,
|
||||
fileSystem,
|
||||
new PowerManagement(),
|
||||
"emby.windows.zip",
|
||||
UpdatePackageFileName,
|
||||
environmentInfo,
|
||||
new NullImageEncoder(),
|
||||
new SystemEvents(logManager.GetLogger("SystemEvents")),
|
||||
@@ -355,7 +368,7 @@ namespace MediaBrowser.ServerApplication
|
||||
}
|
||||
|
||||
// set image encoder here
|
||||
appHost.ImageProcessor.ImageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => appHost.HttpClient, appPaths);
|
||||
appHost.ImageProcessor.ImageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => appHost.HttpClient, appPaths, appHost.LocalizationManager);
|
||||
|
||||
task = task.ContinueWith(new Action<Task>(a => appHost.RunStartupTasks()), TaskContinuationOptions.OnlyOnRanToCompletion | TaskContinuationOptions.AttachedToParent);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user