From e656c9bdc71742ce345ba3daddf4aa606dc04786 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 18 Jan 2013 18:06:05 +0000 Subject: [PATCH] * try to inherit stderr if possible (Java 7) to void lots of error output blocking the pipe --- source/net/sourceforge/filebot/web/AcoustID.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/web/AcoustID.java b/source/net/sourceforge/filebot/web/AcoustID.java index 1056163f..e2d1ffb2 100644 --- a/source/net/sourceforge/filebot/web/AcoustID.java +++ b/source/net/sourceforge/filebot/web/AcoustID.java @@ -7,6 +7,7 @@ import static net.sourceforge.tuned.FileUtilities.*; import java.io.File; import java.io.IOException; +import java.lang.ProcessBuilder.Redirect; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; @@ -16,6 +17,8 @@ import java.util.List; import java.util.Map; import java.util.Scanner; import java.util.concurrent.TimeUnit; +import java.util.logging.Level; +import java.util.logging.Logger; import javax.swing.Icon; @@ -108,7 +111,13 @@ public class AcoustID implements MusicIdentificationService { Process process = null; try { - process = new ProcessBuilder(command).start(); + ProcessBuilder processBuilder = new ProcessBuilder(command); + try { + processBuilder.redirectError(Redirect.INHERIT); + } catch (Throwable e) { + Logger.getLogger(AcoustID.class.getName()).log(Level.WARNING, "Unable to inherit IO: " + e.getMessage()); + } + process = processBuilder.start(); } catch (Exception e) { throw new IOException("Failed to exec fpcalc: " + e.getMessage()); }