OSDN Git Service

リファクタリング
authoryukihane <yukihane.feather@gmail.com>
Wed, 3 Aug 2011 16:16:17 +0000 (01:16 +0900)
committeryukihane <yukihane.feather@gmail.com>
Wed, 3 Aug 2011 16:16:17 +0000 (01:16 +0900)
frontend/src/saccubus/converter/FfmpegCommand.java

index 64b2eb4..da8641a 100644 (file)
@@ -145,7 +145,13 @@ public class FfmpegCommand extends AbstractCommand {
             cmdList.add(scaled.getWidth() + "x" + scaled.getHeight());
         }
 
-        List<String> avfilterArgs = getAvfilterOptions(ov, addComment, commPath, addTcomment, tcommPath, isHD);
+        List<String> avfilterArgs = getAvfilterOptions(ov.getAvfilterOption());
+        if (!getFfmpeg().isVhookDisabled()) {
+            String vhookArg = getVhookArg(addComment, commPath, addTcomment, tcommPath, isHD);
+            if(StringUtils.isNotBlank(vhookArg)){
+                avfilterArgs.add(vhookArg);
+            }
+        }
 
         if (!avfilterArgs.isEmpty()) {
             cmdList.add("-vfilters");
@@ -192,18 +198,11 @@ public class FfmpegCommand extends AbstractCommand {
         }
     }
 
-    private List<String> getAvfilterOptions(FfmpegOption ov, boolean addComment, String commPath, boolean addTcomment,
-            String tcommPath, boolean isHD) throws UnsupportedEncodingException {
+    private List<String> getAvfilterOptions(String avfilterOption) {
         final List<String> avfilterArgs = new ArrayList<String>();
-        final String avfilterOption = ov.getAvfilterOption();
         if (StringUtils.isNotBlank(avfilterOption)) {
             avfilterArgs.add(avfilterOption);
         }
-        final String vhookArg = (getFfmpeg().isVhookDisabled())
-                ? null : getVhookArg(addComment, commPath, addTcomment, tcommPath, isHD);
-        if (vhookArg != null) {
-            avfilterArgs.add(vhookArg);
-        }
         return avfilterArgs;
     }