Update FFmpegWrapper.cs (#200)
This commit is contained in:
parent
508ab9897f
commit
a9cdaf66b0
@ -415,14 +415,9 @@ public static class FFmpegWrapper
|
||||
RedirectStandardError = stderr
|
||||
};
|
||||
|
||||
var ffmpeg = new Process
|
||||
using (var ffmpeg = new Process { StartInfo = info })
|
||||
{
|
||||
StartInfo = info
|
||||
};
|
||||
|
||||
Logger?.LogDebug(
|
||||
"Starting ffmpeg with the following arguments: {Arguments}",
|
||||
ffmpeg.StartInfo.Arguments);
|
||||
Logger?.LogDebug("Starting ffmpeg with the following arguments: {Arguments}", ffmpeg.StartInfo.Arguments);
|
||||
|
||||
ffmpeg.Start();
|
||||
|
||||
@ -432,23 +427,21 @@ public static class FFmpegWrapper
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger?.LogDebug(
|
||||
"ffmpeg priority could not be modified. {Message}",
|
||||
e.Message);
|
||||
Logger?.LogDebug("ffmpeg priority could not be modified. {Message}", e.Message);
|
||||
}
|
||||
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
var buf = new byte[4096];
|
||||
var bytesRead = 0;
|
||||
int bytesRead;
|
||||
|
||||
do
|
||||
using (var streamReader = stderr ? ffmpeg.StandardError : ffmpeg.StandardOutput)
|
||||
{
|
||||
while ((bytesRead = streamReader.BaseStream.Read(buf, 0, buf.Length)) > 0)
|
||||
{
|
||||
var streamReader = stderr ? ffmpeg.StandardError : ffmpeg.StandardOutput;
|
||||
bytesRead = streamReader.BaseStream.Read(buf, 0, buf.Length);
|
||||
ms.Write(buf, 0, bytesRead);
|
||||
}
|
||||
while (bytesRead > 0);
|
||||
}
|
||||
|
||||
ffmpeg.WaitForExit(timeout);
|
||||
|
||||
@ -463,6 +456,7 @@ public static class FFmpegWrapper
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fingerprint a queued episode.
|
||||
|
Loading…
x
Reference in New Issue
Block a user