Skip to content

Commit

Permalink
fix: add 'quit encoding' method
Browse files Browse the repository at this point in the history
  • Loading branch information
sam80180 committed Nov 10, 2023
1 parent ec0ef8b commit 60c1c1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions jave-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
9 changes: 9 additions & 0 deletions jave-core/src/main/java/ws/schild/jave/Encoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -667,4 +669,11 @@ public void abortEncoding() {
ffmpeg = null;
}
}

public void quitEncoding() throws IOException { // https://stackoverflow.com/a/21032143/12857692
final OutputStream ingreso = this.ffmpeg.getOutputStream();
final byte b[] = "q".getBytes(StandardCharsets.US_ASCII);
ingreso.write(b);
ingreso.flush();
}
}

0 comments on commit 60c1c1c

Please sign in to comment.