mirror of
https://github.com/imputnet/cobalt.git
synced 2025-01-19 13:18:28 +00:00
web/libav: shrink buffer _after_ ffmpeg is done running
Some checks are pending
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run tests / test service functionality (push) Waiting to run
Run tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
Some checks are pending
Run tests / check lockfile correctness (push) Waiting to run
Run tests / web sanity check (push) Waiting to run
Run tests / api sanity check (push) Waiting to run
Run tests / test service functionality (push) Waiting to run
Run tests / test service: ${{ matrix.service }} (push) Blocked by required conditions
This commit is contained in:
parent
e084092f37
commit
e79f466c5f
|
@ -63,12 +63,6 @@ export default class LibAVWrapper {
|
||||||
writtenData.set(data, pos);
|
writtenData.set(data, pos);
|
||||||
};
|
};
|
||||||
|
|
||||||
// if we didn't need as much space as we allocated for some reason,
|
|
||||||
// shrink the buffer so that we don't inflate the file with zeros
|
|
||||||
if (writtenData.length > actualSize) {
|
|
||||||
writtenData = writtenData.slice(0, actualSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
await this.libav.ffmpeg([
|
await this.libav.ffmpeg([
|
||||||
'-nostdin', '-y',
|
'-nostdin', '-y',
|
||||||
'-threads', this.concurrency.toString(),
|
'-threads', this.concurrency.toString(),
|
||||||
|
@ -80,6 +74,12 @@ export default class LibAVWrapper {
|
||||||
await this.libav.unlink(outputName);
|
await this.libav.unlink(outputName);
|
||||||
await this.libav.unlinkreadaheadfile("input");
|
await this.libav.unlinkreadaheadfile("input");
|
||||||
|
|
||||||
|
// if we didn't need as much space as we allocated for some reason,
|
||||||
|
// shrink the buffer so that we don't inflate the file with zeros
|
||||||
|
if (writtenData.length > actualSize) {
|
||||||
|
writtenData = writtenData.slice(0, actualSize);
|
||||||
|
}
|
||||||
|
|
||||||
const renderBlob = new Blob(
|
const renderBlob = new Blob(
|
||||||
[ writtenData ],
|
[ writtenData ],
|
||||||
{ type: output.type }
|
{ type: output.type }
|
||||||
|
|
Loading…
Reference in a new issue