Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpacifico authored Mar 29, 2021
1 parent 223012a commit d58f1ee
Showing 1 changed file with 6 additions and 40 deletions.
46 changes: 6 additions & 40 deletions src/library/FFMPEG.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package library;

import java.awt.Color;
import java.awt.Cursor;
import java.awt.FileDialog;
import java.awt.Image;
Expand Down Expand Up @@ -63,6 +62,7 @@
import application.OverlayWindow;
import application.Settings;
import application.Shutter;
import application.Utils;

public class FFMPEG extends Shutter {

Expand All @@ -82,7 +82,7 @@ public class FFMPEG extends Shutter {
public static String outPoint = "";
public static String postInPoint = "";
private static boolean firstInput = true;
public static int firstScreenIndex = 0;
public static int firstScreenIndex = -1;
public static StringBuilder videoDevices;
public static StringBuilder audioDevices;

Expand All @@ -101,6 +101,8 @@ public static void run(String cmd) {

time = 0;
fps = 0;

firstScreenIndex = -1;

elapsedTime = (System.currentTimeMillis() - previousElapsedTime);
error = false;
Expand Down Expand Up @@ -589,7 +591,7 @@ public void run() {
}*/

//Get current screen index
if (cmd.contains("avfoundation") && line.contains("Capture screen"))
if (cmd.contains("avfoundation") && line.contains("Capture screen") && firstScreenIndex == -1)
{
String s[] = line.split("\\[");
String s2[] = s[2].split("\\]");
Expand Down Expand Up @@ -823,44 +825,8 @@ protected static void setBAB(String fichier, String extension, String sortie) {
{
File file = new File(liste.getElementAt(i));

progressBar1.setIndeterminate(true);
lblEncodageEnCours.setForeground(Color.LIGHT_GRAY);
lblEncodageEnCours.setText(file.getName());
tempsRestant.setVisible(false);
btnStart.setEnabled(false);
btnCancel.setEnabled(true);
comboFonctions.setEnabled(false);

long fileSize = 0;
do {
fileSize = file.length();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {} // Permet d'attendre la nouvelle valeur de la copie
} while (fileSize != file.length() && cancelled == false);

// pour Windows
while (file.renameTo(file) == false && cancelled == false) {
if (file.exists() == false) // Dans le cas où on annule la copie en cours
break;
try {
Thread.sleep(100);
} catch (InterruptedException e) {
}
}

if (cancelled)
{
progressBar1.setIndeterminate(false);
lblEncodageEnCours.setText(language.getProperty("lblEncodageEnCours"));
btnStart.setEnabled(true);
btnCancel.setEnabled(false);
comboFonctions.setEnabled(true);
if (Utils.waitFileCompleted(file) == false)
break;
}

progressBar1.setIndeterminate(false);
btnCancel.setEnabled(false);
}
//Scanning

Expand Down

0 comments on commit d58f1ee

Please sign in to comment.