From cafc8356b202932f58d902a861bfbc3181b8e0f9 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 17 Mar 2015 17:02:54 -0400 Subject: [PATCH] hls fixes --- MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 13 ++++++++----- MediaBrowser.Api/Playback/StreamState.cs | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 7fe8a08c7..054bef1dd 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -290,12 +290,15 @@ namespace MediaBrowser.Api.Playback.Hls { using (var reader = new StreamReader(fileStream)) { - var text = await reader.ReadToEndAsync().ConfigureAwait(false); - - // If it appears in the playlist, it's done - if (text.IndexOf(segmentFilename, StringComparison.OrdinalIgnoreCase) != -1) + while (!reader.EndOfStream) { - return GetSegmentResult(segmentPath, segmentIndex, segmentLength, transcodingJob); + var text = await reader.ReadLineAsync().ConfigureAwait(false); + + // If it appears in the playlist, it's done + if (text.IndexOf(segmentFilename, StringComparison.OrdinalIgnoreCase) != -1) + { + return GetSegmentResult(segmentPath, segmentIndex, segmentLength, transcodingJob); + } } } } diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 6bbcef591..aa382ba43 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -66,7 +66,7 @@ namespace MediaBrowser.Api.Playback public string LiveTvStreamId { get; set; } public int SegmentLength = 3; - public bool EnableGenericHlsSegmenter; + public bool EnableGenericHlsSegmenter = false; public int HlsListSize { get