add ffprobe error handling

This commit is contained in:
Luke Pulverenti 2015-09-30 01:24:23 -04:00
parent 5637142100
commit 9f1a8d1dc3

View File

@ -238,8 +238,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
var result = _jsonSerializer.DeserializeFromStream<InternalMediaInfoResult>(process.StandardOutput.BaseStream); var result = _jsonSerializer.DeserializeFromStream<InternalMediaInfoResult>(process.StandardOutput.BaseStream);
if (result != null) if (result.streams == null && result.format == null)
{ {
throw new ApplicationException("ffprobe failed - streams and format are both null.");
}
if (result.streams != null) if (result.streams != null)
{ {
// Normalize aspect ratio if invalid // Normalize aspect ratio if invalid
@ -285,7 +288,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
return mediaInfo; return mediaInfo;
} }
}
catch catch
{ {
StopProcess(processWrapper, 100, true); StopProcess(processWrapper, 100, true);