From 4e7e9eef76b343f220f5d7a23ae8a8ba6660eb89 Mon Sep 17 00:00:00 2001 From: yuki Date: Fri, 22 Jan 2010 08:57:46 +0000 Subject: [PATCH] =?utf8?q?=E4=B8=80=E6=99=82=E3=83=95=E3=82=A1=E3=82=A4?= =?utf8?q?=E3=83=AB=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6=E3=80=81=201.tmp?= =?utf8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88=E3=83=AA=E4=BB=A5?= =?utf8?q?=E4=B8=8B=E3=81=AB=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B=E3=82=88?= =?utf8?q?=E3=81=86=E5=A4=89=E6=9B=B4=202.=E3=83=A6=E3=83=8B=E3=83=BC?= =?utf8?q?=E3=82=AF=E5=90=8D=E3=82=92=E8=A8=AD=E5=AE=9A=E3=81=99=E3=82=8B?= =?utf8?q?=E3=82=88=E3=81=86=E5=A4=89=E6=9B=B4(=E5=90=8C=E6=99=82=E3=81=AB?= =?utf8?q?=E5=AE=9F=E8=A1=8C=E3=81=97=E3=81=9F=E5=A0=B4=E5=90=88=E3=80=81?= =?utf8?q?=E5=BE=93=E6=9D=A5=E3=81=AF=E5=90=8C=E5=90=8D=E3=81=AE=E3=83=86?= =?utf8?q?=E3=83=B3=E3=83=9D=E3=83=A9=E3=83=AA=E3=83=95=E3=82=A1=E3=82=A4?= =?utf8?q?=E3=83=AB=E3=81=A7=E5=87=A6=E7=90=86=E3=81=97=E3=82=88=E3=81=86?= =?utf8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=9F=E3=82=81?= =?utf8?q?=E3=80=81=E3=81=86=E3=81=BE=E3=81=8F=E3=81=84=E3=81=8B=E3=81=AA?= =?utf8?q?=E3=81=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://192.168.11.7/svn/saccubus/trunk@345 c066991c-cf13-ec4a-a49a-846e61667af5 --- frontend/src/saccubus/converter/FfmpegCommand.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/saccubus/converter/FfmpegCommand.java b/frontend/src/saccubus/converter/FfmpegCommand.java index c56cc48..e2071fb 100644 --- a/frontend/src/saccubus/converter/FfmpegCommand.java +++ b/frontend/src/saccubus/converter/FfmpegCommand.java @@ -21,9 +21,9 @@ import yukihane.swf.Cws2Fws; */ public class FfmpegCommand extends AbstractCommand { - private final File commentMiddleFile = new File("./vhook.tmp"); - private final File tcommMiddleFile = new File("./tcomment.tmp"); - private static final String TMP_CWS = "fws_tmp.swf"; + private final File commentMiddleFile; + private final File tcommMiddleFile; + private final File TMP_CWS; private final File commentFile; private final File tcommFile; private final File videoFile; @@ -31,7 +31,7 @@ public class FfmpegCommand extends AbstractCommand { private final Ffmpeg ffmpeg; FfmpegCommand(TextProgressListener listener, ConvertStopFlag flag, File commentFile, File tcommFile, - File videoFile, File convertedVideoFile, Ffmpeg ffmpeg) { + File videoFile, File convertedVideoFile, Ffmpeg ffmpeg) throws IOException { super(listener, flag); this.commentFile = commentFile; this.tcommFile = tcommFile; @@ -39,6 +39,10 @@ public class FfmpegCommand extends AbstractCommand { this.convertedVideoFile = convertedVideoFile; this.ffmpeg = ffmpeg; + File tmpDir = new File("tmp"); + commentMiddleFile = File.createTempFile("vhk", ".tmp", tmpDir); + tcommMiddleFile = File.createTempFile("tcom", ".tmp", tmpDir); + TMP_CWS = File.createTempFile("cws", ".swf", tmpDir); } public boolean execute() throws InterruptedException, IOException { @@ -51,6 +55,9 @@ public class FfmpegCommand extends AbstractCommand { if (tcommMiddleFile.exists()) { tcommMiddleFile.delete(); } + if (TMP_CWS.exists()) { + TMP_CWS.delete(); + } } } @@ -89,7 +96,7 @@ public class FfmpegCommand extends AbstractCommand { private int converting_video(File videoFile, File convertedVideoFile, boolean addComment, String vhook_path, boolean addTcomment, String tcommPath, FfmpegOption ov) throws InterruptedException, IOException { - File fwsFile = Cws2Fws.createFws(videoFile, new File(TMP_CWS)); + File fwsFile = Cws2Fws.createFws(videoFile, TMP_CWS); StringBuffer sb = new StringBuffer(); sb.append("\""); -- 2.11.0