Fix 12 code analysis errors in MediaEncoding projects - use LoggerMessage source generators and specific exception types
This commit is contained in:
@@ -50,10 +50,13 @@ public static class FfProbeKeyframeExtractor
|
||||
{
|
||||
process.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||
}
|
||||
catch
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// We do not care if process priority setting fails
|
||||
// Ideally log a warning but this does not have a logger available
|
||||
// Process may have already exited - ignore
|
||||
}
|
||||
catch (System.ComponentModel.Win32Exception)
|
||||
{
|
||||
// Priority setting may not be supported on this platform - ignore
|
||||
}
|
||||
|
||||
return ParseStream(process.StandardOutput);
|
||||
@@ -67,9 +70,13 @@ public static class FfProbeKeyframeExtractor
|
||||
process.Kill();
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
// We do not care if this fails
|
||||
// Process may have already exited - ignore
|
||||
}
|
||||
catch (System.ComponentModel.Win32Exception)
|
||||
{
|
||||
// Process termination may fail - ignore
|
||||
}
|
||||
|
||||
throw;
|
||||
|
||||
Reference in New Issue
Block a user