web/encode: skip reader if stream was skipped

This commit is contained in:
dumbmoron 2024-08-23 18:38:57 +00:00
parent c966cf36e7
commit f3a67554ff
No known key found for this signature in database

View file

@ -222,7 +222,11 @@ export default class EncodeLibAV extends LibAVWrapper {
await libav.ff_write_multi(output_ctx, write_pkt, starterPackets);
let writePromise = Promise.resolve();
await Promise.all(pipes.map(async (_, i) => {
await Promise.all(pipes.map(async (pipe, i) => {
if (pipe === null) {
return;
}
while (true) {
const { done, value } = await readers[i].read();
if (done) break;