Update progress when processing

pull/209/head
xufulong 3 years ago
parent a59cee3de6
commit 63edbdacd3
  1. 2
      app/src/main/java/com/frank/ffmpeg/FFmpegCmd.java
  2. 4
      app/src/main/java/com/frank/ffmpeg/handler/FFmpegHandler.java

@ -168,7 +168,7 @@ public class FFmpegCmd {
if (mProgressListener != null) {
if (position > 0 && duration > 0) {
int progress = position * 100 / duration;
if (progress < 100 || state == STATE_FINISH || state == STATE_ERROR) {
if (progress < 100) {
mProgressListener.onProgress(progress, duration);
}
} else {

@ -32,7 +32,7 @@ public class FFmpegHandler {
public final static int MSG_INFO = 2222;
private Handler mHandler;
private final Handler mHandler;
private boolean isContinue = false;
@ -53,6 +53,8 @@ public class FFmpegHandler {
if (commandLine == null) {
return;
}
mHandler.removeMessages(MSG_PROGRESS);
mHandler.removeCallbacksAndMessages(null);
FFmpegCmd.execute(commandLine, new OnHandleListener() {
@Override
public void onBegin() {

Loading…
Cancel
Save