Browse Source

Updated code as per jellyfin/master as version i amended didn't execute.

BaronGreenback 5 years ago
parent
commit
70c638d1d4

+ 1 - 2
Emby.Server.Implementations/ApplicationHost.cs

@@ -604,8 +604,7 @@ namespace Emby.Server.Implementations
             // TODO: Refactor to eliminate the circular dependency here so that Lazy<T> isn't required
             // TODO: Add StartupOptions.FFmpegPath to IConfiguration and remove this custom activation
             serviceCollection.AddTransient(provider => new Lazy<EncodingHelper>(provider.GetRequiredService<EncodingHelper>));
-            serviceCollection.AddSingleton<IMediaEncoder>(provider =>
-                ActivatorUtilities.CreateInstance<MediaBrowser.MediaEncoding.Encoder.MediaEncoder>(provider, _startupOptions.FFmpegPath ?? string.Empty));
+            serviceCollection.AddSingleton<IMediaEncoder, MediaBrowser.MediaEncoding.Encoder.MediaEncoder>();
 
             // TODO: Refactor to eliminate the circular dependencies here so that Lazy<T> isn't required
             serviceCollection.AddTransient(provider => new Lazy<ILibraryMonitor>(provider.GetRequiredService<ILibraryMonitor>));

+ 1 - 2
Emby.Server.Implementations/Services/ServiceController.cs

@@ -178,7 +178,7 @@ namespace Emby.Server.Implementations.Services
             var serviceType = httpHost.GetServiceTypeByRequest(requestType);
 
             var service = httpHost.CreateInstance(serviceType, req);
-            
+
             var serviceRequiresContext = service as IRequiresRequest;
             if (serviceRequiresContext != null)
             {
@@ -189,5 +189,4 @@ namespace Emby.Server.Implementations.Services
             return ServiceExecGeneral.Execute(serviceType, req, service, requestDto, requestType.GetMethodName());
         }
     }
-
 }