From 367e16dcdf0250c0bf8b819aa0f95b9154036e49 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 29 Jun 2016 22:38:20 -0400 Subject: [PATCH 1/6] add logging --- .../Connect/ConnectEntryPoint.cs | 2 +- MediaBrowser.Server.Implementations/Connect/ConnectManager.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index ea12e332df..3c4b477d53 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -41,7 +41,7 @@ namespace MediaBrowser.Server.Implementations.Connect public void Run() { - Task.Run(() => LoadCachedAddress()); + LoadCachedAddress(); _timer = new PeriodicTimer(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(3)); } diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index 6190a9da08..ce39601fd1 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -359,6 +359,8 @@ namespace MediaBrowser.Server.Implementations.Connect { var path = CacheFilePath; + _logger.Debug("Loading data from {0}", path); + try { lock (_dataFileLock) From 3ebfb594560259be5571b0103363795af56d3c59 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 29 Jun 2016 23:11:25 -0400 Subject: [PATCH 2/6] add error handling --- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 5b9a2a6820..b5be4eb871 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -322,7 +322,11 @@ namespace MediaBrowser.MediaEncoding.Encoder files = Directory.GetFiles(path, "*", SearchOption.AllDirectories); ffmpegPath = files.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffmpeg", StringComparison.OrdinalIgnoreCase)); - ffprobePath = GetProbePathFromEncoderPath(ffmpegPath); + + if (!string.IsNullOrWhiteSpace(ffmpegPath)) + { + ffprobePath = GetProbePathFromEncoderPath(ffmpegPath); + } } return new Tuple(ffmpegPath, ffprobePath); From 2733c598b26f137f657319e041cf3984dace55eb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 29 Jun 2016 23:29:46 -0400 Subject: [PATCH 3/6] remove unused components --- .../MediaBrowser.Controller.csproj | 2 -- .../Providers/ISeriesOrderManager.cs | 11 ------ .../Providers/ISeriesOrderProvider.cs | 10 ------ .../Manager/SeriesOrderManager.cs | 35 ------------------- .../MediaBrowser.Providers.csproj | 1 - .../TV/TheTVDB/TvdbSeriesProvider.cs | 16 +-------- .../ApplicationHost.cs | 6 ---- 7 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 MediaBrowser.Controller/Providers/ISeriesOrderManager.cs delete mode 100644 MediaBrowser.Controller/Providers/ISeriesOrderProvider.cs delete mode 100644 MediaBrowser.Providers/Manager/SeriesOrderManager.cs diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 9b4c35c419..d1429c366e 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -302,7 +302,6 @@ - @@ -330,7 +329,6 @@ - diff --git a/MediaBrowser.Controller/Providers/ISeriesOrderManager.cs b/MediaBrowser.Controller/Providers/ISeriesOrderManager.cs deleted file mode 100644 index 970f7a7be5..0000000000 --- a/MediaBrowser.Controller/Providers/ISeriesOrderManager.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace MediaBrowser.Controller.Providers -{ - public interface ISeriesOrderManager - { - Task FindSeriesIndex(string orderType, string seriesName); - void AddParts(IEnumerable orderProviders); - } -} diff --git a/MediaBrowser.Controller/Providers/ISeriesOrderProvider.cs b/MediaBrowser.Controller/Providers/ISeriesOrderProvider.cs deleted file mode 100644 index ee0f3c197f..0000000000 --- a/MediaBrowser.Controller/Providers/ISeriesOrderProvider.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; - -namespace MediaBrowser.Controller.Providers -{ - public interface ISeriesOrderProvider - { - string OrderType { get; } - Task FindSeriesIndex(string seriesName); - } -} \ No newline at end of file diff --git a/MediaBrowser.Providers/Manager/SeriesOrderManager.cs b/MediaBrowser.Providers/Manager/SeriesOrderManager.cs deleted file mode 100644 index 1050bdbbd6..0000000000 --- a/MediaBrowser.Providers/Manager/SeriesOrderManager.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using MediaBrowser.Controller.Providers; - -namespace MediaBrowser.Providers.Manager -{ - public class SeriesOrderManager : ISeriesOrderManager - { - private Dictionary _providers; - - public void AddParts(IEnumerable orderProviders) - { - _providers = orderProviders - .GroupBy(p => p.OrderType) - .ToDictionary(g => g.Key, g => g.ToArray()); - } - - public async Task FindSeriesIndex(string orderType, string seriesName) - { - ISeriesOrderProvider[] providers; - if (!_providers.TryGetValue(orderType, out providers)) - return null; - - foreach (ISeriesOrderProvider provider in providers) - { - int? index = await provider.FindSeriesIndex(seriesName); - if (index != null) - return index; - } - - return null; - } - } -} \ No newline at end of file diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj index 240b2e2cca..99d8b15b69 100644 --- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj +++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj @@ -103,7 +103,6 @@ - diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs index 49ca5cdf20..b6cc8777d8 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs @@ -38,17 +38,15 @@ namespace MediaBrowser.Providers.TV private readonly IServerConfigurationManager _config; private readonly CultureInfo _usCulture = new CultureInfo("en-US"); private readonly ILogger _logger; - private readonly ISeriesOrderManager _seriesOrder; private readonly ILibraryManager _libraryManager; - public TvdbSeriesProvider(IZipClient zipClient, IHttpClient httpClient, IFileSystem fileSystem, IServerConfigurationManager config, ILogger logger, ISeriesOrderManager seriesOrder, ILibraryManager libraryManager) + public TvdbSeriesProvider(IZipClient zipClient, IHttpClient httpClient, IFileSystem fileSystem, IServerConfigurationManager config, ILogger logger, ILibraryManager libraryManager) { _zipClient = zipClient; _httpClient = httpClient; _fileSystem = fileSystem; _config = config; _logger = logger; - _seriesOrder = seriesOrder; _libraryManager = libraryManager; Current = this; } @@ -112,23 +110,11 @@ namespace MediaBrowser.Providers.TV result.HasMetadata = true; FetchSeriesData(result, itemId.MetadataLanguage, itemId.ProviderIds, cancellationToken); - await FindAnimeSeriesIndex(result.Item, itemId).ConfigureAwait(false); } return result; } - private async Task FindAnimeSeriesIndex(Series series, SeriesInfo info) - { - var index = await _seriesOrder.FindSeriesIndex(SeriesOrderTypes.Anime, series.Name); - if (index == null) - return; - - var offset = info.AnimeSeriesIndex - index; - var id = string.Format(TvdbSeriesOffsetFormat, series.GetProviderId(MetadataProviders.Tvdb), offset); - series.SetProviderId(TvdbSeriesOffset, id); - } - internal static int? GetSeriesOffset(Dictionary seriesProviderIds) { string idString; diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 651b0e01f5..8978cec5f0 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -160,7 +160,6 @@ namespace MediaBrowser.Server.Startup.Common private IHttpServer HttpServer { get; set; } private IDtoService DtoService { get; set; } private IImageProcessor ImageProcessor { get; set; } - private ISeriesOrderManager SeriesOrderManager { get; set; } /// /// Gets or sets the media encoder. @@ -476,9 +475,6 @@ namespace MediaBrowser.Server.Startup.Common ProviderManager = new ProviderManager(HttpClient, ServerConfigurationManager, LibraryMonitor, LogManager, FileSystemManager, ApplicationPaths, () => LibraryManager, JsonSerializer); RegisterSingleInstance(ProviderManager); - SeriesOrderManager = new SeriesOrderManager(); - RegisterSingleInstance(SeriesOrderManager); - RegisterSingleInstance(() => new SearchEngine(LogManager, LibraryManager, UserManager)); HttpServer = ServerFactory.CreateServer(this, LogManager, ServerConfigurationManager, NetworkManager, "Emby", "web/index.html"); @@ -819,8 +815,6 @@ namespace MediaBrowser.Server.Startup.Common GetExports(), GetExports()); - SeriesOrderManager.AddParts(GetExports()); - ImageProcessor.AddParts(GetExports()); LiveTvManager.AddParts(GetExports(), GetExports(), GetExports()); From cbeb77c0ad366f25e3cb26d80e27648598240c59 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 29 Jun 2016 23:34:56 -0400 Subject: [PATCH 4/6] reduce repeated deserialization of dlna profiles --- MediaBrowser.Dlna/DlnaManager.cs | 44 ++++++++++++++----- .../Connect/ConnectEntryPoint.cs | 2 + .../Connect/ConnectManager.cs | 2 +- 3 files changed, 36 insertions(+), 12 deletions(-) diff --git a/MediaBrowser.Dlna/DlnaManager.cs b/MediaBrowser.Dlna/DlnaManager.cs index 3cc6a4379d..b4127a91f1 100644 --- a/MediaBrowser.Dlna/DlnaManager.cs +++ b/MediaBrowser.Dlna/DlnaManager.cs @@ -29,6 +29,8 @@ namespace MediaBrowser.Dlna private readonly IJsonSerializer _jsonSerializer; private readonly IServerApplicationHost _appHost; + private readonly Dictionary _profiles = new Dictionary(StringComparer.Ordinal); + public DlnaManager(IXmlSerializer xmlSerializer, IFileSystem fileSystem, IApplicationPaths appPaths, @@ -300,20 +302,31 @@ namespace MediaBrowser.Dlna private DeviceProfile ParseProfileXmlFile(string path, DeviceProfileType type) { - try + lock (_profiles) { - var profile = (DeviceProfile)_xmlSerializer.DeserializeFromFile(typeof(DeviceProfile), path); + DeviceProfile profile; + if (_profiles.TryGetValue(path, out profile)) + { + return profile; + } - profile.Id = path.ToLower().GetMD5().ToString("N"); - profile.ProfileType = type; + try + { + profile = (DeviceProfile)_xmlSerializer.DeserializeFromFile(typeof(DeviceProfile), path); - return profile; - } - catch (Exception ex) - { - _logger.ErrorException("Error parsing profile xml: {0}", ex, path); + profile.Id = path.ToLower().GetMD5().ToString("N"); + profile.ProfileType = type; - return null; + _profiles[path] = profile; + + return profile; + } + catch (Exception ex) + { + _logger.ErrorException("Error parsing profile xml: {0}", ex, path); + + return null; + } } } @@ -428,7 +441,7 @@ namespace MediaBrowser.Dlna var newFilename = _fileSystem.GetValidFilename(profile.Name) + ".xml"; var path = Path.Combine(UserProfilesPath, newFilename); - _xmlSerializer.SerializeToFile(profile, path); + SaveProfile(profile, path); } public void UpdateProfile(DeviceProfile profile) @@ -455,6 +468,15 @@ namespace MediaBrowser.Dlna _fileSystem.DeleteFile(current.Path); } + SaveProfile(profile, path); + } + + private void SaveProfile(DeviceProfile profile, string path) + { + lock (_profiles) + { + _profiles[path] = profile; + } _xmlSerializer.SerializeToFile(profile, path); } diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index 3c4b477d53..79872b1004 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -162,6 +162,8 @@ namespace MediaBrowser.Server.Implementations.Connect { var path = CacheFilePath; + _logger.Info("Loading data from {0}", path); + try { var endpoint = _fileSystem.ReadAllText(path, Encoding.UTF8); diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index ce39601fd1..8dbea707d1 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -359,7 +359,7 @@ namespace MediaBrowser.Server.Implementations.Connect { var path = CacheFilePath; - _logger.Debug("Loading data from {0}", path); + _logger.Info("Loading data from {0}", path); try { From 525f7804532bb0d5a1dc38668fbcf511acc2877c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 30 Jun 2016 00:23:52 -0400 Subject: [PATCH 5/6] add startup error handling --- .../MediaEncoding/IMediaEncoder.cs | 2 +- .../Encoder/EncoderValidator.cs | 24 +++++++++---------- .../Encoder/MediaEncoder.cs | 15 +++++++++++- .../MediaBrowser.MediaEncoding.csproj | 1 + .../Connect/ConnectEntryPoint.cs | 10 ++++---- .../Connect/ConnectManager.cs | 7 ++++-- .../ApplicationHost.cs | 16 +------------ .../MediaBrowser.Server.Startup.Common.csproj | 1 - 8 files changed, 39 insertions(+), 37 deletions(-) rename MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs => MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs (88%) diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs index 12c893b0fc..62377b19e0 100644 --- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs +++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs @@ -131,7 +131,7 @@ namespace MediaBrowser.Controller.MediaEncoding /// System.String. string EscapeSubtitleFilterPath(string path); - void Init(); + Task Init(); Task UpdateEncoderPath(string path, string pathType); } diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs similarity index 88% rename from MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs rename to MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index d92dc1b965..99581332de 100644 --- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -1,31 +1,29 @@ -using MediaBrowser.Common.Configuration; -using MediaBrowser.Model.Logging; -using System; +using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; -using System.Collections.Generic; -using CommonIO; +using MediaBrowser.Model.Logging; -namespace MediaBrowser.Server.Startup.Common.FFMpeg +namespace MediaBrowser.MediaEncoding.Encoder { - public class FFmpegValidator + public class EncoderValidator { private readonly ILogger _logger; - private readonly IApplicationPaths _appPaths; - private readonly IFileSystem _fileSystem; - public FFmpegValidator(ILogger logger, IApplicationPaths appPaths, IFileSystem fileSystem) + public EncoderValidator(ILogger logger) { _logger = logger; - _appPaths = appPaths; - _fileSystem = fileSystem; } - public Tuple,List> Validate(string encoderPath) + public Tuple, List> Validate(string encoderPath) { + _logger.Info("Validating media encoder at {0}", encoderPath); + var decoders = GetDecoders(encoderPath); var encoders = GetEncoders(encoderPath); + _logger.Info("Encoder validation complete"); + return new Tuple, List>(decoders, encoders); } diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index b5be4eb871..7264ad2d17 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -132,7 +132,20 @@ namespace MediaBrowser.MediaEncoding.Encoder return false; } - public void Init() + public async Task Init() + { + InitPaths(); + + if (!string.IsNullOrWhiteSpace(FFMpegPath)) + { + var result = new EncoderValidator(_logger).Validate(FFMpegPath); + + SetAvailableDecoders(result.Item1); + SetAvailableEncoders(result.Item2); + } + } + + private void InitPaths() { ConfigureEncoderPaths(); diff --git a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj index 5576a49bd0..7943534515 100644 --- a/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj +++ b/MediaBrowser.MediaEncoding/MediaBrowser.MediaEncoding.csproj @@ -71,6 +71,7 @@ + diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs index 79872b1004..28a62c0124 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectEntryPoint.cs @@ -44,11 +44,12 @@ namespace MediaBrowser.Server.Implementations.Connect LoadCachedAddress(); _timer = new PeriodicTimer(TimerCallback, null, TimeSpan.FromSeconds(5), TimeSpan.FromHours(3)); + ((ConnectManager)_connectManager).Start(); } private readonly string[] _ipLookups = { - "http://bot.whatismyipaddress.com", + "http://bot.whatismyipaddress.com", "https://connect.emby.media/service/ip" }; @@ -78,17 +79,18 @@ namespace MediaBrowser.Server.Implementations.Connect } // If this produced an ipv6 address, try again - if (validIpAddress == null || validIpAddress.AddressFamily == AddressFamily.InterNetworkV6) + if (validIpAddress != null && validIpAddress.AddressFamily == AddressFamily.InterNetworkV6) { foreach (var ipLookupUrl in _ipLookups) { try { - validIpAddress = await GetIpAddress(ipLookupUrl, true).ConfigureAwait(false); + var newAddress = await GetIpAddress(ipLookupUrl, true).ConfigureAwait(false); // Try to find the ipv4 address, if present - if (validIpAddress.AddressFamily == AddressFamily.InterNetwork) + if (newAddress.AddressFamily == AddressFamily.InterNetwork) { + validIpAddress = newAddress; break; } } diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index 8dbea707d1..24750de94c 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -139,11 +139,14 @@ namespace MediaBrowser.Server.Implementations.Connect _securityManager = securityManager; _fileSystem = fileSystem; - _config.ConfigurationUpdated += _config_ConfigurationUpdated; - LoadCachedData(); } + internal void Start() + { + _config.ConfigurationUpdated += _config_ConfigurationUpdated; + } + internal void OnWanAddressResolved(IPAddress address) { DiscoveredWanIpAddress = address; diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 8978cec5f0..1e5c54d93c 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -322,7 +322,7 @@ namespace MediaBrowser.Server.Startup.Common await base.RunStartupTasks().ConfigureAwait(false); - InitMediaEncoder(); + await MediaEncoder.Init().ConfigureAwait(false); Logger.Info("ServerId: {0}", SystemId); Logger.Info("Core startup complete"); @@ -350,20 +350,6 @@ namespace MediaBrowser.Server.Startup.Common LogManager.RemoveConsoleOutput(); } - private void InitMediaEncoder() - { - MediaEncoder.Init(); - - Task.Run(() => - { - var result = new FFmpegValidator(Logger, ApplicationPaths, FileSystemManager).Validate(MediaEncoder.EncoderPath); - - var mediaEncoder = (MediaEncoder) MediaEncoder; - mediaEncoder.SetAvailableDecoders(result.Item1); - mediaEncoder.SetAvailableEncoders(result.Item2); - }); - } - public override Task Init(IProgress progress) { HttpPort = ServerConfigurationManager.Configuration.HttpServerPortNumber; diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index 5b88a6bd9c..808d25fc9c 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -68,7 +68,6 @@ - From 9a012e458cd12ca7b9630ce7f3074318db9deee8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 30 Jun 2016 00:41:15 -0400 Subject: [PATCH 6/6] update validation --- MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index 99581332de..6059108c81 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -134,13 +134,12 @@ namespace MediaBrowser.MediaEncoding.Encoder { process.BeginErrorReadLine(); - using (var reader = new StreamReader(process.StandardOutput.BaseStream)) - { - return reader.ReadToEnd(); - } + return process.StandardOutput.ReadToEnd(); } catch { + _logger.Info("Killing process {0} {1}", path, arguments); + // Hate having to do this try {