Changeset 153

Show
Ignore:
Timestamp:
02/16/07 20:28:29 (2 years ago)
Author:
jlee
Message:

Leaving the .exe off in Windows no longer works

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/org/thestaticvoid/iriverter/Converter.java

    r146 r153  
    198198                List commandList = new ArrayList(); 
    199199                 
    200                 commandList.add(mplayerPath + "mencoder"); 
     200                commandList.add(mplayerPath + MPlayerInfo.MENCODER_BIN); 
    201201                 
    202202                commandList.add(inputVideo); 
     
    363363                 
    364364                if (manualSplitInfo.getMarks()[0].getTime() == Mark.START_MARK) 
    365                         runConversionCommand(new String[]{mplayerPath + "mencoder", manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + manualSplitInfo.getMarks()[1].getTime()}); 
     365                        runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + manualSplitInfo.getMarks()[1].getTime()}); 
    366366                else if (manualSplitInfo.getMarks()[1].getTime() == Mark.END_MARK) 
    367                         runConversionCommand(new String[]{mplayerPath + "mencoder", manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime()}); 
     367                        runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime()}); 
    368368                else 
    369                         runConversionCommand(new String[]{mplayerPath + "mencoder", manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime(), "-endpos", "" + (manualSplitInfo.getMarks()[1].getTime() - manualSplitInfo.getMarks()[0].getTime())}); 
     369                        runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, manualSplitInfo.getVideo(), "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + manualSplitInfo.getMarks()[0].getTime(), "-endpos", "" + (manualSplitInfo.getMarks()[1].getTime() - manualSplitInfo.getMarks()[0].getTime())}); 
    370370        } 
    371371         
     
    413413                                progressDialogInfo.setOutputVideo(new File(joinVideosInfo.getOutputVideo()).getName()); 
    414414                                progressDialogInfo.setStatus("Writing header"); 
    415                                 splitVideo(joinVideosInfo.getOutputVideo(), runConversionCommand(new String[]{mplayerPath + "mencoder", "-forceidx", tempFile.toString(), "-o", joinVideosInfo.getOutputVideo(), "-ovc", "copy", "-oac", "copy"})); 
     415                                splitVideo(joinVideosInfo.getOutputVideo(), runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, "-forceidx", tempFile.toString(), "-o", joinVideosInfo.getOutputVideo(), "-ovc", "copy", "-oac", "copy"})); 
    416416                        } 
    417417                } catch (IOException e) { 
     
    467467                         
    468468                        if ((i + 1) == 1) 
    469                                 runConversionCommand(new String[]{mplayerPath + "mencoder", inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + (length / pieces)}); 
     469                                runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-endpos", "" + (length / pieces)}); 
    470470                        else if ((i + 1) == pieces) 
    471                                 runConversionCommand(new String[]{mplayerPath + "mencoder", inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i}); 
     471                                runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i}); 
    472472                        else 
    473                                 runConversionCommand(new String[]{mplayerPath + "mencoder", inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i, "-endpos", "" + (length / pieces)}); 
     473                                runConversionCommand(new String[]{mplayerPath + MPlayerInfo.MENCODER_BIN, inputVideo, "-o", outputVideo, "-ovc", "copy", "-oac", "copy", "-ss", "" + (length / pieces) * i, "-endpos", "" + (length / pieces)}); 
    474474                } 
    475475        } 
  • trunk/src/org/thestaticvoid/iriverter/ConverterUI.java

    r152 r153  
    423423                                while (!canceled) 
    424424                                        try { 
    425                                                 proc = Runtime.getRuntime().exec(new String[]{MPlayerInfo.getMPlayerPath() + "mplayer", file}); 
     425                                                proc = Runtime.getRuntime().exec(new String[]{MPlayerInfo.getMPlayerPath() + MPlayerInfo.MPLAYER_BIN, file}); 
    426426                                                canceled = true; 
    427427                                        } catch (IOException io) { 
  • trunk/src/org/thestaticvoid/iriverter/DVD.java

    r152 r153  
    220220                                        try { 
    221221                                                java.util.List commandList = new ArrayList(); 
    222                                                 commandList.add(MPlayerInfo.getMPlayerPath() + "mplayer"); 
     222                                                commandList.add(MPlayerInfo.getMPlayerPath() + File.separator + MPlayerInfo.MPLAYER_BIN); 
    223223                                                commandList.add("-dvd-device"); 
    224224                                                commandList.add(getDrive()); 
  • trunk/src/org/thestaticvoid/iriverter/MPlayerInfo.java

    r151 r153  
    2727 
    2828public class MPlayerInfo { 
     29        public static final String MPLAYER_BIN = System.getProperty("os.name").indexOf("Windows") > 0 ? "mplayer.exe" : "mplayer"; 
     30        public static final String MENCODER_BIN = System.getProperty("os.name").indexOf("Windows") > 0 ? "mencoder.exe" : "mencoder"; 
     31         
    2932        private Process proc; 
    3033        private StringBuffer mplayerOutput; 
     
    4245                String[] command = null; 
    4346                if (dvdDrive != null) 
    44                         command = new String[]{mplayerPath + File.separator + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", "-dvd-device", dvdDrive, video.toString(), "-v", "-identify"}; 
     47                        command = new String[]{mplayerPath + File.separator + MPLAYER_BIN, "-vo", "null", "-ao", "null", "-frames", "1", "-dvd-device", dvdDrive, video.toString(), "-v", "-identify"}; 
    4548                else 
    46                         command = new String[]{mplayerPath + File.separator + "mplayer", "-vo", "null", "-ao", "null", "-frames", "1", video.toString(), "-identify"}; 
     49                        command = new String[]{mplayerPath + File.separator + MPLAYER_BIN, "-vo", "null", "-ao", "null", "-frames", "1", video.toString(), "-identify"}; 
    4750                 
    4851                String commandStr = ""; 
     
    5457                        proc = Runtime.getRuntime().exec(command); 
    5558                } catch (IOException io) { 
    56                         io.printStackTrace(); 
     59                        Logger.logException(io); 
    5760                } 
    5861                 
     
    6972                        input.close(); 
    7073                } catch (IOException io) { 
    71                         io.printStackTrace(); 
     74                        Logger.logException(io); 
    7275                } 
    7376        }