aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs16
1 files changed, 13 insertions, 3 deletions
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<MediaStream> GetMediaStreamsForItem(IEnumerable<MediaStream> 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;