Updated ffprobe to not use WaitForExit, to avoid thread-blocking.

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti 2012-08-23 18:20:50 -04:00
parent f218e6b583
commit d09e82dfc3

View File

@ -112,6 +112,10 @@ namespace MediaBrowser.Controller.FFMpeg
Process process = new Process(); Process process = new Process();
process.StartInfo = startInfo; process.StartInfo = startInfo;
process.EnableRaisingEvents = true;
process.Exited += process_Exited;
try try
{ {
process.Start(); process.Start();
@ -137,10 +141,11 @@ namespace MediaBrowser.Controller.FFMpeg
return null; return null;
} }
finally }
{
process.Dispose(); static void process_Exited(object sender, EventArgs e)
} {
(sender as Process).Dispose();
} }
private static string GetFFProbeCachePath(Audio item) private static string GetFFProbeCachePath(Audio item)