mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 19:37:55 +02:00
fix: kill ffprobe if keyframe parsing fails
This commit is contained in:
parent
679e83082f
commit
737c739d33
1 changed files with 21 additions and 2 deletions
|
@ -38,9 +38,28 @@ public static class FfProbeKeyframeExtractor
|
|||
EnableRaisingEvents = true
|
||||
};
|
||||
|
||||
process.Start();
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
|
||||
return ParseStream(process.StandardOutput);
|
||||
return ParseStream(process.StandardOutput);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!process.HasExited)
|
||||
{
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// We do not care if this fails
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal static KeyframeData ParseStream(StreamReader reader)
|
||||
|
|
Loading…
Reference in a new issue