web/remux: warn user & terminate libav before switching tabs

warning about aborting processing will be shown before navigating away from remuxing tab
This commit is contained in:
wukko
2024-09-09 03:08:18 +06:00
parent dd1c630c71
commit 8a18645e0b
4 changed files with 48 additions and 22 deletions

View File

@@ -24,6 +24,13 @@ export default class LibAVWrapper {
}
}
async terminate() {
if (this.libav) {
const libav = await this.libav;
libav.terminate();
}
}
async probe(blob: Blob) {
if (!this.libav) throw new Error("LibAV wasn't initialized");
const libav = await this.libav;
@@ -173,7 +180,7 @@ export default class LibAVWrapper {
await libav.unlink(outputName);
await libav.unlink('progress.txt');
await libav.unlinkreadaheadfile("input");
} catch {}
} catch { /* catch & ignore */ }
}
}