From 0e5809120d18e763de35ff8ba46833dfd1df3f01 Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Mon, 6 Nov 2017 20:09:01 +0200 Subject: [PATCH] Fix #113: read buffer before waiting --- QuickLook.Plugin/QuickLook.Plugin.ImageViewer/exiv2/Meta.cs | 2 +- .../QuickLook.Plugin.VideoViewer/ffmpeg/FFprobe.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/exiv2/Meta.cs b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/exiv2/Meta.cs index f03e0069..93e4d27b 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/exiv2/Meta.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.ImageViewer/exiv2/Meta.cs @@ -148,9 +148,9 @@ private Dictionary Run(string arg, string regexSplit) p.StartInfo.Arguments = arg; p.StartInfo.StandardOutputEncoding = Encoding.UTF8; p.Start(); - p.WaitForExit(); result = p.StandardOutput.ReadToEnd(); + p.WaitForExit(1000); } return string.IsNullOrWhiteSpace(result) diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ffmpeg/FFprobe.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ffmpeg/FFprobe.cs index e5f57a33..ea11c25c 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ffmpeg/FFprobe.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ffmpeg/FFprobe.cs @@ -51,9 +51,10 @@ private bool Run(string media) p.StartInfo.Arguments = $"-v quiet -print_format xml -show_streams -show_format \"{media}\""; p.StartInfo.StandardOutputEncoding = Encoding.UTF8; p.Start(); - p.WaitForExit(); result = p.StandardOutput.ReadToEnd(); + p.WaitForExit(1000); + } if (string.IsNullOrWhiteSpace(result))