aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas B <6439218+YouKnowBlom@users.noreply.github.com>2020-03-15 15:06:38 +0100
committerAndreas B <6439218+YouKnowBlom@users.noreply.github.com>2020-03-15 15:06:38 +0100
commit85da15685f7a761af3a34f1c591bf129aa5deb5f (patch)
treef8a8b227ce663f36ee35b40d42f54221b1ef861a
parent97bca5a9008ba94411c45572e690decc58805b85 (diff)
Refactor DynamicHlsService.AppendPlaylist to use StringBuilder
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 262f51786..8787eb2a3 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -724,7 +724,10 @@ namespace MediaBrowser.Api.Playback.Hls
private void AppendPlaylist(StringBuilder builder, StreamState state, string url, int bitrate, string subtitleGroup)
{
- var header = "#EXT-X-STREAM-INF:BANDWIDTH=" + bitrate.ToString(CultureInfo.InvariantCulture) + ",AVERAGE-BANDWIDTH=" + bitrate.ToString(CultureInfo.InvariantCulture);
+ builder.Append("#EXT-X-STREAM-INF:BANDWIDTH=")
+ .Append(bitrate.ToString(CultureInfo.InvariantCulture))
+ .Append(",AVERAGE-BANDWIDTH=")
+ .Append(bitrate.ToString(CultureInfo.InvariantCulture));
// tvos wants resolution, codecs, framerate
//if (state.TargetFramerate.HasValue)
@@ -734,10 +737,12 @@ namespace MediaBrowser.Api.Playback.Hls
if (!string.IsNullOrWhiteSpace(subtitleGroup))
{
- header += string.Format(",SUBTITLES=\"{0}\"", subtitleGroup);
+ builder.Append(",SUBTITLES=\"")
+ .Append(subtitleGroup)
+ .Append('"');
}
- builder.AppendLine(header);
+ builder.Append(Environment.NewLine);
builder.AppendLine(url);
}