diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-08-25 11:40:21 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-08-25 11:40:21 -0400 |
| commit | 2652c8918c83bcfe602d3a03ca1269baf0c81e9a (patch) | |
| tree | 3153d72ecb95e86e8f35b9617f890d092b0d50f5 | |
| parent | f0f9f5c68c21992df0faf54680a14818224522cc (diff) | |
hls fix
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 0d501066e..27429b8db 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -13,7 +13,6 @@ using MediaBrowser.Model.IO; using MediaBrowser.Model.Serialization; using ServiceStack; using System; -using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; using System.IO; @@ -713,11 +712,13 @@ namespace MediaBrowser.Api.Playback.Hls var index = 0; + double segmentLength = state.SegmentLength; + while (seconds > 0) { - var length = seconds >= state.SegmentLength ? state.SegmentLength : seconds; + var length = seconds >= state.SegmentLength ? segmentLength : seconds; - builder.AppendLine("#EXTINF:" + length.ToString(UsCulture) + ","); + builder.AppendLine("#EXTINF:" + length.ToString("0.000000", UsCulture) + ","); builder.AppendLine(string.Format("hlsdynamic/{0}/{1}{2}{3}", @@ -726,7 +727,7 @@ namespace MediaBrowser.Api.Playback.Hls GetSegmentFileExtension(isOutputVideo), queryString)); - seconds -= state.SegmentLength; + seconds -= length; index++; } |
