diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-06 18:57:21 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-06 18:57:21 -0500 |
| commit | 446232394887fb3dea1ad81906e9a3d23bf134c1 (patch) | |
| tree | 247126513d9456512918c9602896defa42ca5bb8 /MediaBrowser.Controller | |
| parent | 73677b94c6d2768bc541d74d0cd45b3ad38335d4 (diff) | |
removed duplicate image extraction method
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/MediaInfo/FFMpegManager.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs | 13 |
2 files changed, 8 insertions, 14 deletions
diff --git a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs index 746157bb3..e3604eb0e 100644 --- a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs +++ b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs @@ -177,7 +177,14 @@ namespace MediaBrowser.Controller.MediaInfo Directory.CreateDirectory(parentPath); - await _encoder.ExtractImage(inputPath, type, false, video.Video3DFormat, time, path, cancellationToken).ConfigureAwait(false); + using (var stream = await _encoder.ExtractImage(inputPath, type, false, video.Video3DFormat, time, cancellationToken).ConfigureAwait(false)) + { + using (var fileStream = _fileSystem.GetFileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, true)) + { + await stream.CopyToAsync(fileStream).ConfigureAwait(false); + } + } + chapter.ImagePath = path; changesMade = true; } diff --git a/MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs b/MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs index e77cd14d1..d8cad48b3 100644 --- a/MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs +++ b/MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs @@ -31,19 +31,6 @@ namespace MediaBrowser.Controller.MediaInfo /// <param name="isAudio">if set to <c>true</c> [is audio].</param> /// <param name="threedFormat">The threed format.</param> /// <param name="offset">The offset.</param> - /// <param name="outputPath">The output path.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task.</returns> - Task ExtractImage(string[] inputFiles, InputType type, bool isAudio, Video3DFormat? threedFormat, TimeSpan? offset, string outputPath, CancellationToken cancellationToken); - - /// <summary> - /// Extracts the image. - /// </summary> - /// <param name="inputFiles">The input files.</param> - /// <param name="type">The type.</param> - /// <param name="isAudio">if set to <c>true</c> [is audio].</param> - /// <param name="threedFormat">The threed format.</param> - /// <param name="offset">The offset.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>Task{Stream}.</returns> Task<Stream> ExtractImage(string[] inputFiles, InputType type, bool isAudio, Video3DFormat? threedFormat, TimeSpan? offset, CancellationToken cancellationToken); |
