Просмотр исходного кода

Apply suggestions from code review

Co-authored-by: Cody Robibero <cody@robibe.ro>
whiteowl3 3 лет назад
Родитель
Сommit
16a449a023
1 измененных файлов с 1 добавлено и 2 удалено
  1. 1 2
      MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

+ 1 - 2
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -458,10 +458,9 @@ namespace MediaBrowser.MediaEncoding.Encoder
             {
             {
                 _logger.LogDebug("{ProcessFileName} {ProcessArgs}", process.StartInfo.FileName, process.StartInfo.Arguments);
                 _logger.LogDebug("{ProcessFileName} {ProcessArgs}", process.StartInfo.FileName, process.StartInfo.Arguments);
             }
             }
-            
             using (var processWrapper = new ProcessWrapper(process, this))
             using (var processWrapper = new ProcessWrapper(process, this))
             {
             {
-                MemoryStream memoryStream = new MemoryStream();
+                await using var memoryStream = new MemoryStream();
                 _logger.LogDebug("Starting ffprobe with args {Args}", args);
                 _logger.LogDebug("Starting ffprobe with args {Args}", args);
                 StartProcess(processWrapper);
                 StartProcess(processWrapper);
                 await process.StandardOutput.BaseStream.CopyToAsync(memoryStream, cancellationToken: cancellationToken);
                 await process.StandardOutput.BaseStream.CopyToAsync(memoryStream, cancellationToken: cancellationToken);