Skip to content

Commit

Permalink
ffmpeg progress bugfixing
Browse files Browse the repository at this point in the history
  • Loading branch information
olir committed Apr 1, 2018
1 parent faa1b84 commit 80f24f2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void run() {
scheduleNext();
Thread.sleep(10L);
}
System.out.println("ExecutorThread shudown");
System.out.println("ExecutorThread shutdown");
} catch (InterruptedException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,15 @@ public String time(double t) {
}

private double time(String t) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss.SS");
LocalTime lt = LocalTime.parse(t, formatter);
return ((double) lt.toNanoOfDay()) / 1000000000.0;
try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss.SS");
LocalTime lt = LocalTime.parse(t, formatter);
return ((double) lt.toNanoOfDay()) / 1000000000.0;
} catch (java.time.format.DateTimeParseException e) {
// ffmpeg causes DateTimeParseException: Text '-577014:32:22.77' could not be parsed
System.err.println(e.getLocalizedMessage() + ": t=" + t);
return 0.0;
}
}

@Override
Expand Down

0 comments on commit 80f24f2

Please sign in to comment.