From e5fdf31ec43cf41ffc34fa69e328242dcc482975 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 5 Oct 2015 12:05:08 -0400 Subject: update subtitle transcoding --- .../Library/MediaSourceManager.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Library') diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs index 2f23aad1b..9694965c7 100644 --- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs +++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs @@ -105,6 +105,18 @@ namespace MediaBrowser.Server.Implementations.Library return GetMediaStreamsForItem(list); } + private int GetMaxAllowedBitrateForExternalSubtitleStream() + { + // This is abitrary but at some point it becomes too slow to extract subtitles on the fly + // We need to learn more about when this is the case vs. when it isn't + if (Environment.ProcessorCount >= 8) + { + return 10000000; + } + + return 2000000; + } + private IEnumerable GetMediaStreamsForItem(IEnumerable streams) { var list = streams.ToList(); @@ -117,9 +129,7 @@ namespace MediaBrowser.Server.Implementations.Library { var videoStream = list.FirstOrDefault(i => i.Type == MediaStreamType.Video); - // This is abitrary but at some point it becomes too slow to extract subtitles on the fly - // We need to learn more about when this is the case vs. when it isn't - const int maxAllowedBitrateForExternalSubtitleStream = 10000000; + int maxAllowedBitrateForExternalSubtitleStream = GetMaxAllowedBitrateForExternalSubtitleStream(); var videoBitrate = videoStream == null ? maxAllowedBitrateForExternalSubtitleStream : videoStream.BitRate ?? maxAllowedBitrateForExternalSubtitleStream; -- cgit v1.2.3