Async stream handling: Use interface instead of Func<Stream,Task>

No functional changes
This commit is contained in:
softworkz
2016-08-05 06:08:11 +02:00
parent 894d87fabb
commit 433254c498
9 changed files with 223 additions and 25 deletions

View File

@@ -362,9 +362,9 @@ namespace MediaBrowser.Api.Playback.Progressive
outputHeaders[item.Key] = item.Value;
}
Func<Stream, Task> streamWriter = stream => new ProgressiveFileCopier(FileSystem, job, Logger).StreamFile(outputPath, stream, CancellationToken.None);
var streamSource = new ProgressiveFileCopier(FileSystem, outputPath, outputHeaders, job, Logger, CancellationToken.None);
return ResultFactory.GetAsyncStreamWriter(streamWriter, outputHeaders);
return ResultFactory.GetAsyncStreamWriter(streamSource);
}
finally
{