remove standard output redirect on image extractions

This commit is contained in:
Luke Pulverenti
2016-06-30 22:35:18 -04:00
parent 580a68d19c
commit 00634b62c5
6 changed files with 41 additions and 45 deletions

View File

@@ -139,12 +139,16 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
{
_fileSystem.CreateDirectory(Path.GetDirectoryName(path));
using (var stream = await _encoder.ExtractVideoImage(inputPath, protocol, video.Video3DFormat, time, cancellationToken).ConfigureAwait(false))
var tempFile = await _encoder.ExtractVideoImage(inputPath, protocol, video.Video3DFormat, time, cancellationToken).ConfigureAwait(false);
File.Copy(tempFile, path, true);
try
{
using (var fileStream = _fileSystem.GetFileStream(path, FileMode.Create, FileAccess.Write, FileShare.Read, true))
{
await stream.CopyToAsync(fileStream).ConfigureAwait(false);
}
File.Delete(tempFile);
}
catch
{
}
chapter.ImagePath = path;