ffmpeg.wasm icon indicating copy to clipboard operation
ffmpeg.wasm copied to clipboard

fix: Cancel run promise if the exit() is called

Open pikax opened this issue 3 years ago • 2 comments

The .run() promise will never be resolved if exit is called.

This PR will reject the run promise if is running:

const longRun = ffmpeg.run([/*args*/])

setTimeout(()=> {
  ffmpeg.exit()
}, timeout)

try{
  await longRun(); // before everything after this will never run
 } catch { 
  // handle error
 }
console.log('continue doing work')

pikax avatar Jan 06 '22 12:01 pikax

this PR needs to be merged ASAP. this bug really annoys me cause it breaks promise mechanism.

cainiaokan avatar Apr 18 '22 10:04 cainiaokan

Thank you @pikax

rap2hpoutre avatar May 10 '22 15:05 rap2hpoutre

Thanks for the PR!

jeromewu avatar Aug 14 '22 10:08 jeromewu