Skip to content

Commit 8f68767

Browse files
committed
Add cancel FFmpeg call
1 parent e9b446f commit 8f68767

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

app/src/main/java/protect/videotranscoder/FFmpegUtil.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ public void onFailure(String message)
121121
call(command, handler);
122122
}
123123

124+
/**
125+
* Cancel the current in-progress invocation of FFmpeg
126+
*/
127+
public static void cancelCall()
128+
{
129+
String message;
130+
131+
if(ffmpeg == null || ffmpeg.isFFmpegCommandRunning() == false)
132+
{
133+
message = "Cancel failed, FFmpeg not running";
134+
}
135+
else
136+
{
137+
boolean result = ffmpeg.killRunningProcesses();
138+
message = "Attempt to cancel FFmpeg: " + (result ? "success" : "failed");
139+
}
140+
141+
Log.d(TAG, message);
142+
}
143+
124144
@NonNull
125145
private static String commandToString(String [] cmd)
126146
{

0 commit comments

Comments
 (0)