diff -urp -x '*.class' tmp/src/at/anzac/jvctool/JVCTool.java src/at/anzac/jvctool/JVCTool.java --- tmp/src/at/anzac/jvctool/JVCTool.java 2006-07-21 20:06:30.000000000 +0100 +++ src/at/anzac/jvctool/JVCTool.java 2014-06-08 01:18:23.630516613 +0100 @@ -316,7 +316,7 @@ public class JVCTool System.out.println("processing file '"+_srcDirName+fileNames[i]+"'"); - moi.load(_srcDirName+FileUtil.getNameWithoutExtension(fileNames[i])+".MOI"); + moi.load(_srcDirName+FileUtil.getNameWithoutExtension(fileNames[i])); if(_verbose) { System.out.println(moi); @@ -338,13 +338,15 @@ public class JVCTool newName=StringUtil.replaceAll(newName,"$bandwidth$",moi.getbandwidth()); // find next possible file name - do + tmpName=StringUtil.sanitizeFileName(StringUtil.replaceAll(newName,"$index$",decF.format(n))); + tmpName=StringUtil.sanitizeFileName(StringUtil.replaceAll(tmpName,"$$","$")); + File f = new File(_destDirName+tmpName); + if (f.exists()) { - tmpName=StringUtil.sanitizeFileName(StringUtil.replaceAll(newName,"$index$",decF.format(n))); - tmpName=StringUtil.sanitizeFileName(StringUtil.replaceAll(tmpName,"$$","$")); - n++; + System.out.println(_destDirName+tmpName+" already exists, skipped not overwrite "); + continue; } - while(new File(_destDirName+tmpName).exists()); + n++; newName=_destDirName+tmpName; diff -urp -x '*.class' tmp/src/at/anzac/jvctool/MoiStructure.java src/at/anzac/jvctool/MoiStructure.java --- tmp/src/at/anzac/jvctool/MoiStructure.java 2006-07-21 20:06:30.000000000 +0100 +++ src/at/anzac/jvctool/MoiStructure.java 2014-04-06 07:05:00.075613784 +0100 @@ -13,6 +13,7 @@ package at.anzac.jvctool; import java.io.FileInputStream; +import java.io.File; import java.text.*; /*********************************************************************************************************************** @@ -78,14 +79,37 @@ public class MoiStructure int fLength=0; byte[] fBuffer=new byte[1024]; - FileInputStream f=new FileInputStream(fullFileName); + SimpleDateFormat sdf;// = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); + + File f2 = new File(fullFileName+".MOI"); + if (!f2.exists()) { + System.out.println("File:"+ fullFileName + ".MOI not existe dummy MOI values"); + aspectRatio=AspectRatio_16by9; + quality=Quality_F; + videoLength = 120000; + File file = new File(fullFileName+".MOD"); + sdf = new SimpleDateFormat("yyyy"); + year= Integer.parseInt(sdf.format(file.lastModified())); + sdf = new SimpleDateFormat("MM"); + month= Integer.parseInt(sdf.format(file.lastModified())); + sdf = new SimpleDateFormat("dd"); + day= Integer.parseInt(sdf.format(file.lastModified())); + sdf = new SimpleDateFormat("HH"); + hour= Integer.parseInt(sdf.format(file.lastModified())); + sdf = new SimpleDateFormat("mm"); + minute=Integer.parseInt(sdf.format(file.lastModified())); + return; + } + + + FileInputStream f=new FileInputStream(fullFileName+".MOI"); while(f.read(fBuffer, fLength, 1)!=-1) { - // System.out.println((int)fBuffer[fLength]+" "); + //System.out.println((int)fBuffer[fLength]+" "); fLength++; if(fBuffer.length==fLength) // realloc { - // System.out.println("realloc to size "+fBuffer.length*2); + //System.out.println("realloc to size "+fBuffer.length*2); byte[] temp=new byte[fBuffer.length*2]; for(int n=0; n