diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-28 21:40:46 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-28 21:40:46 -0500 |
| commit | 97ece5bd6f6e6a3dd8226dd9990b48f67c45f22c (patch) | |
| tree | 07addfa562d50651a9007e8d6416c034b43af104 /MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs | |
| parent | 3c8c6abca7c1f61a3f693b01eb567b1e1126d067 (diff) | |
update translations
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs')
| -rw-r--r-- | MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs b/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs index 615203d75..81ba1dc3a 100644 --- a/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs +++ b/MediaBrowser.Server.Startup.Common/FFMpeg/FFmpegValidator.cs @@ -25,8 +25,23 @@ namespace MediaBrowser.Server.Startup.Common.FFMpeg _logger.Info("FFMpeg: {0}", info.EncoderPath); _logger.Info("FFProbe: {0}", info.ProbePath); - var fileInfo = new FileInfo(info.EncoderPath); - var cachePath = Path.Combine(_appPaths.CachePath, "1" + fileInfo.Length.ToString(CultureInfo.InvariantCulture).GetMD5().ToString("N")); + string cacheKey; + + try + { + cacheKey = new FileInfo(info.EncoderPath).Length.ToString(CultureInfo.InvariantCulture).GetMD5().ToString("N"); + } + catch (IOException) + { + // This could happen if ffmpeg is coming from a Path variable and we don't have the full path + cacheKey = Guid.NewGuid().ToString("N"); + } + catch + { + cacheKey = Guid.NewGuid().ToString("N"); + } + + var cachePath = Path.Combine(_appPaths.CachePath, "1" + cacheKey); ValidateCodecs(info.EncoderPath, cachePath); } |
