From 50f353aac7b4032b0b6d273663ec81a15524b77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=91=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=8F=D0=BD=D1=86=D0=B5=D0=B2?= Date: Tue, 28 Apr 2020 22:43:53 +0300 Subject: [PATCH] Added exit code checking to FFProbe stream methods Former-commit-id: 883185b5ec0a54c68fe27fe9a0d2480d15fb19c7 --- FFMpegCore/FFMPEG/FFProbe.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FFMpegCore/FFMPEG/FFProbe.cs b/FFMpegCore/FFMPEG/FFProbe.cs index a9033c4..3030344 100644 --- a/FFMpegCore/FFMPEG/FFProbe.cs +++ b/FFMpegCore/FFMPEG/FFProbe.cs @@ -99,6 +99,7 @@ public VideoInfo ParseVideoInfo(System.IO.Stream stream) if (exitCode != 0) throw new FFMpegException(FFMpegExceptionType.Process, "FFProbe process returned exit status " + exitCode); + var output = string.Join("", instance.OutputData); return ParseVideoInfoInternal(info, output); } @@ -132,6 +133,9 @@ public async Task ParseVideoInfoAsync(System.IO.Stream stream) } var exitCode = await task; + if (exitCode != 0) + throw new FFMpegException(FFMpegExceptionType.Process, "FFProbe process returned exit status " + exitCode); + var output = string.Join("", instance.OutputData); return ParseVideoInfoInternal(info, output); }