From 446232394887fb3dea1ad81906e9a3d23bf134c1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 6 Feb 2014 18:57:21 -0500 Subject: removed duplicate image extraction method --- MediaBrowser.Controller/MediaInfo/FFMpegManager.cs | 9 ++++++++- MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs | 13 ------------- 2 files changed, 8 insertions(+), 14 deletions(-) (limited to 'MediaBrowser.Controller') diff --git a/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs b/MediaBrowser.Controller/MediaInfo/FFMpegManager.cs index 746157bb33..e3604eb0e2 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 e77cd14d17..d8cad48b3e 100644 --- a/MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs +++ b/MediaBrowser.Controller/MediaInfo/IMediaEncoder.cs @@ -23,19 +23,6 @@ namespace MediaBrowser.Controller.MediaInfo /// The version. string Version { get; } - /// - /// Extracts the image. - /// - /// The input files. - /// The type. - /// if set to true [is audio]. - /// The threed format. - /// The offset. - /// The output path. - /// The cancellation token. - /// Task. - Task ExtractImage(string[] inputFiles, InputType type, bool isAudio, Video3DFormat? threedFormat, TimeSpan? offset, string outputPath, CancellationToken cancellationToken); - /// /// Extracts the image. /// -- cgit v1.2.3