From 045fdaf3874c9b57d80a97d0fefdcd3454f7c044 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 26 Jan 2017 01:26:58 -0500 Subject: update live stream bitrates --- Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs | 5 ++--- Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs index f792d8b65..5e0b4ff34 100644 --- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs +++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs @@ -1064,8 +1064,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV var isAudio = false; await new LiveStreamHelper(_mediaEncoder, _logger).AddMediaInfoWithProbe(stream, isAudio, cancellationToken).ConfigureAwait(false); - stream.InferTotalBitrate(); - return new List { stream @@ -1372,13 +1370,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV ActiveRecordingInfo removed; _activeRecordings.TryRemove(timer.Id, out removed); - if (recordingStatus != RecordingStatus.Completed && DateTime.UtcNow < timer.EndDate) + if (recordingStatus != RecordingStatus.Completed && DateTime.UtcNow < timer.EndDate && timer.RetryCount < 10) { const int retryIntervalSeconds = 60; _logger.Info("Retrying recording in {0} seconds.", retryIntervalSeconds); timer.Status = RecordingStatus.New; timer.StartDate = DateTime.UtcNow.AddSeconds(retryIntervalSeconds); + timer.RetryCount++; _timerProvider.AddOrUpdate(timer); } else if (_fileSystem.FileExists(recordPath)) diff --git a/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs b/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs index 78390f084..0313e6fde 100644 --- a/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs +++ b/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs @@ -96,7 +96,7 @@ namespace Emby.Server.Implementations.LiveTv } // Try to estimate this - mediaSource.InferTotalBitrate(); + mediaSource.InferTotalBitrate(true); } } } -- cgit v1.2.3 From db4290c74cd06815ba05165a79c95b89028cb678 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 26 Jan 2017 13:41:12 -0500 Subject: add error handling --- Emby.Server.Implementations/Library/LibraryManager.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs index 71ba465df..c59a22884 100644 --- a/Emby.Server.Implementations/Library/LibraryManager.cs +++ b/Emby.Server.Implementations/Library/LibraryManager.cs @@ -2593,7 +2593,7 @@ namespace Emby.Server.Implementations.Library { foreach (var pathInfo in libraryOptions.PathInfos) { - if (string.IsNullOrWhiteSpace(pathInfo.NetworkPath)) + if (string.IsNullOrWhiteSpace(pathInfo.Path) || string.IsNullOrWhiteSpace(pathInfo.NetworkPath)) { continue; } @@ -2621,10 +2621,13 @@ namespace Emby.Server.Implementations.Library foreach (var map in ConfigurationManager.Configuration.PathSubstitutions) { - var substitutionResult = SubstitutePathInternal(path, map.From, map.To); - if (substitutionResult.Item2) + if (!string.IsNullOrWhiteSpace(map.From)) { - return substitutionResult.Item1; + var substitutionResult = SubstitutePathInternal(path, map.From, map.To); + if (substitutionResult.Item2) + { + return substitutionResult.Item1; + } } } -- cgit v1.2.3