Changeset 81


Ignore:
Timestamp:
04/06/06 22:27:03 (6 years ago)
Author:
jlee
Message:

Use input's frame rate if possible, otherwise use device's max frame rate

Location:
trunk/src
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r80 r81  
    1414 
    1515iriverter_source_files = \ 
    16         org/thestaticvoid/iriverter/FrameRateDialog.java \ 
    1716        org/thestaticvoid/iriverter/DVD.java \ 
    1817        org/thestaticvoid/iriverter/SingleVideoAdapter.java \ 
  • trunk/src/org/thestaticvoid/iriverter/Converter.java

    r79 r81  
    185185                } 
    186186                 
    187                 String vf = "filmdint=io=" + ((int) Math.round(info.getFrameRate() * 1000)) + ":" + ((int) Math.round(converterOptions.getFrameRate() * 1000)); 
     187                double ofps = (info.getFrameRate() > converterOptions.getCurrentProfile().getMaxFrameRate() ? converterOptions.getCurrentProfile().getMaxFrameRate() : info.getFrameRate()); 
     188                 
     189                String vf = "filmdint=io=" + ((int) Math.round(info.getFrameRate() * 1000)) + ":" + ((int) Math.round(ofps * 1000)); 
    188190                if (converterOptions.getPanAndScan()) 
    189191                        vf += ",scale=" + ((int) ((info.getDimensions().getWidth()) * (((double) converterOptions.getDimensions().getHeight()) / (double) info.getDimensions().getHeight()))) + ":" + converterOptions.getDimensions().getHeight() + ",crop=" + converterOptions.getDimensions().getWidth() + ":" + converterOptions.getDimensions().getHeight(); 
     
    228230                commandList.add("-vf"); 
    229231                commandList.add(vf); 
    230                 commandList.add("-af"); 
    231                 commandList.add(af); 
     232                 
     233                if (!af.equals("")) { 
     234                        commandList.add("-af"); 
     235                        commandList.add(af); 
     236                } 
     237                 
    232238                commandList.add("-ofps"); 
    233                 commandList.add("" + converterOptions.getFrameRate()); 
     239                commandList.add("" + ofps); 
    234240                commandList.add("-srate"); 
    235241                commandList.add("44100"); 
     
    280286                } 
    281287                 
    282                 String vf = "filmdint=io=" + ((int) Math.round(info.getFrameRate() * 1000)) + ":" + ((int) Math.round(converterOptions.getFrameRate() * 1000)); 
     288                double ofps = (info.getFrameRate() > converterOptions.getCurrentProfile().getMaxFrameRate() ? converterOptions.getCurrentProfile().getMaxFrameRate() : info.getFrameRate()); 
     289                 
     290                String vf = "filmdint=io=" + ((int) Math.round(info.getFrameRate() * 1000)) + ":" + ((int) Math.round(ofps * 1000)); 
    283291                if (converterOptions.getPanAndScan()) 
    284292                        vf += ",scale=" + ((int) ((info.getDimensions().getWidth()) * (((double) converterOptions.getDimensions().getHeight()) / (double) info.getDimensions().getHeight()))) + ":" + converterOptions.getDimensions().getHeight() + ",crop=" + converterOptions.getDimensions().getWidth() + ":" + converterOptions.getDimensions().getHeight(); 
     
    325333                commandList.add("-vf"); 
    326334                commandList.add(vf); 
    327                 commandList.add("-af"); 
    328                 commandList.add(af); 
     335                 
     336                if (!af.equals("")) { 
     337                        commandList.add("-af"); 
     338                        commandList.add(af); 
     339                } 
     340                 
    329341                commandList.add("-ofps"); 
    330                 commandList.add("" + converterOptions.getFrameRate()); 
     342                commandList.add("" + ofps); 
    331343                commandList.add("-srate"); 
    332344                commandList.add("44100"); 
  • trunk/src/org/thestaticvoid/iriverter/ConverterOptions.java

    r72 r81  
    102102                return Integer.parseInt(audioBitrate); 
    103103        } 
    104          
    105         public double getFrameRate() { 
    106                 String frameRate = readOption("frameRate"); 
    107                 if (frameRate.equals("")) 
    108                         return getCurrentProfile().getMaxFrameRate(); 
    109                  
    110                 return Double.parseDouble(frameRate); 
    111         } 
    112104 
    113105        public Dimensions getDimensions() { 
  • trunk/src/org/thestaticvoid/iriverter/ConverterUI.java

    r73 r81  
    1919        private CTabFolder tabFolder; 
    2020        private Map profileMenuItems, dimensionsMenuItems; 
    21         private MenuItem convert, playFile, newSingleVideo, newDirectory, newDVD, advancedJobs, manualSplit, joinVideos, moveUp, moveDown, closeJob, closeAllJobs, quit, bitrate, videoSize, frameRate, panAndScan, advancedOptions, audioSync, automaticallySplit, volume, contents, about; 
     21        private MenuItem convert, playFile, newSingleVideo, newDirectory, newDVD, advancedJobs, manualSplit, joinVideos, moveUp, moveDown, closeJob, closeAllJobs, quit, bitrate, videoSize, panAndScan, advancedOptions, audioSync, automaticallySplit, volume, contents, about; 
    2222        private Menu videoSizeMenu; 
    2323        private DropTarget target; 
     
    197197                videoSizeMenu = new Menu(shell, SWT.DROP_DOWN); 
    198198                videoSize.setMenu(videoSizeMenu); 
    199                  
    200                 frameRate = new MenuItem(optionsMenu, SWT.PUSH); 
    201                 frameRate.setText("&Frame Rate..."); 
    202                 frameRate.addSelectionListener(this); 
    203199 
    204200                new MenuItem(optionsMenu, SWT.SEPARATOR); 
     
    405401                if (dimensionsMenuItems.containsKey(e.getSource())) { 
    406402 
    407                 } 
    408                  
    409                 if (e.getSource() == frameRate) { 
    410                         FrameRateDialog frameRateDialog = new FrameRateDialog(shell, SWT.NONE, converterOptions.getCurrentProfile().getMaxFrameRate(), converterOptions.getFrameRate()); 
    411                         converterOptions.writeOption("frameRate", "" + frameRateDialog.open()); 
    412403                } 
    413404                 
Note: See TracChangeset for help on using the changeset viewer.