return null when file not exits

Former-commit-id: 1e24b0bef4
This commit is contained in:
weihanli 2020-04-28 19:40:31 +08:00
parent c1393697a3
commit 985fc0cbc4

View file

@ -390,7 +390,7 @@ public VideoInfo Convert(ArgumentContainer arguments, bool skipExistsCheck = fal
throw new FFMpegException(FFMpegExceptionType.Conversion, "Could not process file without error");
_totalTime = TimeSpan.MinValue;
return new VideoInfo(output);
return output.Exists ? new VideoInfo(output) : null;
}
public async Task<VideoInfo> ConvertAsync(ArgumentContainer arguments, bool skipExistsCheck = false)
{
@ -401,7 +401,7 @@ public async Task<VideoInfo> ConvertAsync(ArgumentContainer arguments, bool skip
throw new FFMpegException(FFMpegExceptionType.Conversion, "Could not process file without error");
_totalTime = TimeSpan.MinValue;
return new VideoInfo(output);
return output.Exists ? new VideoInfo(output) : null;
}
private static (VideoInfo[] Input, FileInfo Output) GetInputOutput(ArgumentContainer arguments)