-
Notifications
You must be signed in to change notification settings - Fork 98
Open
Description
We have registered the cancellationToken in the ProcessExtensions.WaitForExitAsync() . The registered cancellation handler attempts to write some data to the process's stdin.
If the process has already exited, there is a try/catch block exists which ignores the InvalidOperationException.
FFmpeg.NET/src/FFmpeg.NET/Extensions/ProcessExtensions.cs
Lines 20 to 33 in 16fe394
| try | |
| { | |
| if (stdInDataInput) | |
| // If standard input used for data input just close it. | |
| // It will force process to stop (closing files). | |
| process.StandardInput.Close(); | |
| else | |
| // Send "q" to ffmpeg, which will force it to stop (closing files). | |
| process.StandardInput.Write("q"); | |
| } | |
| catch (InvalidOperationException) | |
| { | |
| // If the process doesn't exist anymore, ignore it. | |
| } |
However, theStreamWriter.Write() will throw an IOException here when attempting to write q to the stdin of a non-existent process. Therefore, it seems like that we also need to handle the IOException here.
Metadata
Metadata
Assignees
Labels
No labels