Merge pull request #996 from MediaBrowser/master

Merge master changes
This commit is contained in:
Luke
2015-01-31 22:33:08 -05:00
4 changed files with 17 additions and 9 deletions

View File

@@ -503,7 +503,21 @@ namespace MediaBrowser.MediaEncoding.Encoder
process.Start();
var ranToCompletion = process.WaitForExit(120000);
// Need to give ffmpeg enough time to make all the thumbnails, which could be a while,
// but we still need to detect if the process hangs.
// Making the assumption that as long as new jpegs are showing up, everything is good.
bool isResponsive = true;
int lastCount = 0;
while (isResponsive && !process.WaitForExit(120000))
{
int jpegCount = Directory.GetFiles(targetDirectory, "*.jpg").Count();
isResponsive = (jpegCount > lastCount);
lastCount = jpegCount;
}
bool ranToCompletion = process.HasExited;
if (!ranToCompletion)
{