aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ApplicationHost.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-04-11 20:30:20 +0200
committerGitHub <noreply@github.com>2020-04-11 20:30:20 +0200
commit3d611743edacdfbf14ce0e3eda0f01a049185657 (patch)
tree1df920ba36d6faeca2f5a6a141fca7ca257d848b /Emby.Server.Implementations/ApplicationHost.cs
parent14674d446954b24c9754431f550c590083e7a94c (diff)
parent411328827808e115ce207f4c985c9dea1c7211e7 (diff)
Merge pull request #2680 from mark-monteiro/remove-common-process
Remove CommonProcess and ProcessFactory
Diffstat (limited to 'Emby.Server.Implementations/ApplicationHost.cs')
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs34
1 files changed, 11 insertions, 23 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index cb32b8c01..81a80ddb2 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -30,7 +30,6 @@ using Emby.Server.Implementations.Configuration;
using Emby.Server.Implementations.Cryptography;
using Emby.Server.Implementations.Data;
using Emby.Server.Implementations.Devices;
-using Emby.Server.Implementations.Diagnostics;
using Emby.Server.Implementations.Dto;
using Emby.Server.Implementations.HttpServer;
using Emby.Server.Implementations.HttpServer.Security;
@@ -86,7 +85,6 @@ using MediaBrowser.MediaEncoding.BdInfo;
using MediaBrowser.Model.Activity;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Cryptography;
-using MediaBrowser.Model.Diagnostics;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Globalization;
@@ -337,8 +335,6 @@ namespace Emby.Server.Implementations
internal IImageEncoder ImageEncoder { get; private set; }
- protected IProcessFactory ProcessFactory { get; private set; }
-
protected readonly IXmlSerializer XmlSerializer;
protected ISocketFactory SocketFactory { get; private set; }
@@ -680,9 +676,6 @@ namespace Emby.Server.Implementations
serviceCollection.AddSingleton(XmlSerializer);
- ProcessFactory = new ProcessFactory();
- serviceCollection.AddSingleton(ProcessFactory);
-
serviceCollection.AddSingleton(typeof(IStreamHelper), typeof(StreamHelper));
var cryptoProvider = new CryptographyProvider();
@@ -743,7 +736,6 @@ namespace Emby.Server.Implementations
LoggerFactory.CreateLogger<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(),
ServerConfigurationManager,
FileSystemManager,
- ProcessFactory,
LocalizationManager,
() => SubtitleEncoder,
startupConfig,
@@ -857,8 +849,7 @@ namespace Emby.Server.Implementations
FileSystemManager,
MediaEncoder,
HttpClient,
- MediaSourceManager,
- ProcessFactory);
+ MediaSourceManager);
serviceCollection.AddSingleton(SubtitleEncoder);
serviceCollection.AddSingleton(typeof(IResourceFileManager), typeof(ResourceFileManager));
@@ -1678,15 +1669,17 @@ namespace Emby.Server.Implementations
throw new NotSupportedException();
}
- var process = ProcessFactory.Create(new ProcessOptions
+ var process = new Process
{
- FileName = url,
- EnableRaisingEvents = true,
- UseShellExecute = true,
- ErrorDialog = false
- });
-
- process.Exited += ProcessExited;
+ StartInfo = new ProcessStartInfo
+ {
+ FileName = url,
+ UseShellExecute = true,
+ ErrorDialog = false
+ },
+ EnableRaisingEvents = true
+ };
+ process.Exited += (sender, args) => ((Process)sender).Dispose();
try
{
@@ -1699,11 +1692,6 @@ namespace Emby.Server.Implementations
}
}
- private static void ProcessExited(object sender, EventArgs e)
- {
- ((IProcess)sender).Dispose();
- }
-
public virtual void EnableLoopback(string appName)
{
}