diff options
Diffstat (limited to 'MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs index 0a9a44641..f601f4aa3 100644 --- a/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs +++ b/MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs @@ -23,6 +23,8 @@ namespace MediaBrowser.Api.Playback.Progressive private const int BufferSize = 81920; private long _bytesWritten = 0; + public long StartPosition { get; set; } + public bool AllowEndOfFile = true; public ProgressiveFileCopier(IFileSystem fileSystem, string path, Dictionary<string, string> outputHeaders, TranscodingJob job, ILogger logger, CancellationToken cancellationToken) { @@ -50,7 +52,12 @@ namespace MediaBrowser.Api.Playback.Progressive using (var fs = _fileSystem.GetFileStream(_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true)) { - while (eofCount < 15) + if (StartPosition > 0) + { + fs.Position = StartPosition; + } + + while (eofCount < 15 || !AllowEndOfFile) { var bytesRead = await CopyToAsyncInternal(fs, outputStream, BufferSize, _cancellationToken).ConfigureAwait(false); |
