File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ module.exports = (_options = {}) => {
9595 }
9696 } ;
9797
98-
9998 /*
10099 * Determine whether the Core is loaded.
101100 */
@@ -171,6 +170,21 @@ module.exports = (_options = {}) => {
171170 }
172171 } ;
173172
173+ /**
174+ * forcibly terminate the ffmpeg program.
175+ */
176+ const exit = ( ) => {
177+ if ( Core === null ) {
178+ throw NO_LOAD ;
179+ } else {
180+ running = false ;
181+ Core . exit ( 1 ) ;
182+ Core = null ;
183+ ffmpeg = null ;
184+ runResolve = null ;
185+ }
186+ } ;
187+
174188 const setProgress = ( _progress ) => {
175189 progress = _progress ;
176190 } ;
@@ -191,6 +205,7 @@ module.exports = (_options = {}) => {
191205 load,
192206 isLoaded,
193207 run,
208+ exit,
194209 FS ,
195210 } ;
196211} ;
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export interface FFmpeg {
7777 setProgress ( progress : ProgressCallback ) : void ;
7878 setLogger ( log : LogCallback ) : void ;
7979 setLogging ( logging : boolean ) : void ;
80+ exit ( ) : void ;
8081}
8182
8283/*
You can’t perform that action at this time.
0 commit comments