aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-15 13:13:55 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-07-15 13:13:55 -0400
commit2e91d69d20e49f971d9890674d3016351ee87ccd (patch)
tree5ce0f330f639434127ada9ccae290bbf5cf400ba /MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
parent61aa25c3585d5f7acf1b88ddaf30a8b04e0c466e (diff)
update async stream writing
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index 868d8d488..d8b7ce2ef 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -13,6 +13,7 @@ using ServiceStack.Web;
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.IO;
using System.Threading;
using System.Threading.Tasks;
using CommonIO;
@@ -336,17 +337,19 @@ namespace MediaBrowser.Api.Playback.Progressive
state.Dispose();
}
- var result = new ProgressiveStreamWriter(outputPath, Logger, FileSystem, job);
+ var outputHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- result.Options["Content-Type"] = contentType;
+ outputHeaders["Content-Type"] = contentType;
// Add the response headers to the result object
foreach (var item in responseHeaders)
{
- result.Options[item.Key] = item.Value;
+ outputHeaders[item.Key] = item.Value;
}
- return result;
+ Func<Stream,Task> streamWriter = stream => new ProgressiveFileCopier(FileSystem, job, Logger).StreamFile(outputPath, stream);
+
+ return ResultFactory.GetAsyncStreamWriter(streamWriter, outputHeaders);
}
finally
{