From ed1284fc314612095c1b59d5cee82a37d2294e96 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: Sat, 2 May 2020 13:07:34 +0300 Subject: [PATCH] Fixed VideoInfo ToString when no File is specified Former-commit-id: b007e9105a61161d6166c437a5754c45b1176a17 --- FFMpegCore/VideoInfo.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FFMpegCore/VideoInfo.cs b/FFMpegCore/VideoInfo.cs index 3bacdb9..3a4cb75 100644 --- a/FFMpegCore/VideoInfo.cs +++ b/FFMpegCore/VideoInfo.cs @@ -8,6 +8,7 @@ namespace FFMpegCore { public class VideoInfo { + private const string NoVideoPlaceholder = "NULL"; private FileInfo _file; internal VideoInfo() @@ -148,10 +149,10 @@ public static VideoInfo FromStream(System.IO.Stream stream) /// public override string ToString() { - return "Video Path : " + FullName + Environment.NewLine + - "Video Root : " + Directory.FullName + Environment.NewLine + - "Video Name: " + Name + Environment.NewLine + - "Video Extension : " + Extension + Environment.NewLine + + return "Video Path : " + (_file != null ? FullName : NoVideoPlaceholder) + Environment.NewLine + + "Video Root : " + (_file != null ? Directory.FullName : NoVideoPlaceholder) + Environment.NewLine + + "Video Name: " + (_file != null ? Name : NoVideoPlaceholder) + Environment.NewLine + + "Video Extension : " + (_file != null ? Extension : NoVideoPlaceholder) + Environment.NewLine + "Video Duration : " + Duration + Environment.NewLine + "Audio Format : " + AudioFormat + Environment.NewLine + "Video Format : " + VideoFormat + Environment.NewLine +