Skip to content

Commit

Permalink
Fix #113: read buffer before waiting
Browse files Browse the repository at this point in the history
  • Loading branch information
xupefei committed Nov 6, 2017
1 parent a2660fc commit 0e58091
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ private Dictionary<string, string> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 0e58091

Please sign in to comment.