add error handling

This commit is contained in:
Luke Pulverenti 2016-06-29 23:11:25 -04:00
parent 367e16dcdf
commit 3ebfb59456

View File

@ -322,8 +322,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
files = Directory.GetFiles(path, "*", SearchOption.AllDirectories); files = Directory.GetFiles(path, "*", SearchOption.AllDirectories);
ffmpegPath = files.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffmpeg", StringComparison.OrdinalIgnoreCase)); ffmpegPath = files.FirstOrDefault(i => string.Equals(Path.GetFileNameWithoutExtension(i), "ffmpeg", StringComparison.OrdinalIgnoreCase));
if (!string.IsNullOrWhiteSpace(ffmpegPath))
{
ffprobePath = GetProbePathFromEncoderPath(ffmpegPath); ffprobePath = GetProbePathFromEncoderPath(ffmpegPath);
} }
}
return new Tuple<string, string>(ffmpegPath, ffprobePath); return new Tuple<string, string>(ffmpegPath, ffprobePath);
} }