aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-16 23:17:23 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-05-16 23:17:23 -0400
commit94a2cfa9f560a1caede24195755ae95068648210 (patch)
tree792a7ddfb21edd5509b03c35f0103b8895f8a269 /MediaBrowser.Server.Implementations/LiveTv
parent4cee0e44a3d87e9fd4d438992277809c10c923ac (diff)
updated translations
Diffstat (limited to 'MediaBrowser.Server.Implementations/LiveTv')
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs24
1 files changed, 17 insertions, 7 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
index 46c186b0ac..9706ed6d25 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
@@ -164,30 +164,40 @@ namespace MediaBrowser.Server.Implementations.LiveTv
mediaSource.DefaultAudioStreamIndex = audioStream.Index;
}
- // Try to estimate this
- if (!mediaSource.Bitrate.HasValue)
+ var videoStream = mediaSource.MediaStreams.FirstOrDefault(i => i.Type == Model.Entities.MediaStreamType.Video);
+ if (videoStream != null)
{
- var videoStream = mediaSource.MediaStreams.FirstOrDefault(i => i.Type == Model.Entities.MediaStreamType.Video);
- if (videoStream != null)
+ if (!videoStream.BitRate.HasValue)
{
var width = videoStream.Width ?? 1920;
if (width >= 1900)
{
- mediaSource.Bitrate = 10000000;
+ videoStream.BitRate = 8000000;
}
else if (width >= 1260)
{
- mediaSource.Bitrate = 6000000;
+ videoStream.BitRate = 3000000;
}
else if (width >= 700)
{
- mediaSource.Bitrate = 4000000;
+ videoStream.BitRate = 1000000;
}
}
}
+
+ // Try to estimate this
+ if (!mediaSource.Bitrate.HasValue)
+ {
+ var total = mediaSource.MediaStreams.Select(i => i.BitRate ?? 0).Sum();
+
+ if (total > 0)
+ {
+ mediaSource.Bitrate = total;
+ }
+ }
}
public Task CloseMediaSource(string liveStreamId, CancellationToken cancellationToken)