aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-06-26 13:04:11 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-06-26 13:04:11 -0400
commita49e513bc2e772905da1a2c3a7e56ce96abb8a11 (patch)
tree4cd6d543935bc4b4276b935d2f2cd3f36dc141f9 /MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
parent4cbaecf2c4180963ce04ed4079ca58eaeaa40143 (diff)
get more exact hls segment times
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs')
-rw-r--r--MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
index f99cef8eb..36ae7f100 100644
--- a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
+++ b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
@@ -1,7 +1,6 @@
using MediaBrowser.Common.IO;
using MediaBrowser.Model.Logging;
using ServiceStack.Web;
-using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
@@ -60,7 +59,7 @@ namespace MediaBrowser.Api.Playback.Progressive
{
try
{
- await StreamFile(Path, responseStream).ConfigureAwait(false);
+ await new ProgressiveFileCopier(_fileSystem).StreamFile(Path, responseStream).ConfigureAwait(false);
}
catch
{
@@ -73,14 +72,18 @@ namespace MediaBrowser.Api.Playback.Progressive
ApiEntryPoint.Instance.OnTranscodeEndRequest(Path, TranscodingJobType.Progressive);
}
}
+ }
- /// <summary>
- /// Streams the file.
- /// </summary>
- /// <param name="path">The path.</param>
- /// <param name="outputStream">The output stream.</param>
- /// <returns>Task{System.Boolean}.</returns>
- private async Task StreamFile(string path, Stream outputStream)
+ public class ProgressiveFileCopier
+ {
+ private readonly IFileSystem _fileSystem;
+
+ public ProgressiveFileCopier(IFileSystem fileSystem)
+ {
+ _fileSystem = fileSystem;
+ }
+
+ public async Task StreamFile(string path, Stream outputStream)
{
var eofCount = 0;
long position = 0;