Add explicit disposability to Inputs (#126)

This commit is contained in:
Vanilagy
2025-09-21 20:18:59 +02:00
parent 34c01fbb10
commit 608c769a7e
22 changed files with 479 additions and 116 deletions
+5 -5
View File
@@ -14,7 +14,7 @@ const __dirname = new URL('.', import.meta.url).pathname;
test('can loop over all samples', async () => {
const filePath = path.join(__dirname, '..', 'public/sample.flac');
const input = new Input({
using input = new Input({
source: new FilePathSource(filePath),
formats: ALL_FORMATS,
});
@@ -56,7 +56,7 @@ test('can loop over all samples', async () => {
test('can do random access', async () => {
const filePath = path.join(__dirname, '..', 'public/sample.flac');
const input = new Input({
using input = new Input({
source: new FilePathSource(filePath),
formats: ALL_FORMATS,
});
@@ -89,7 +89,7 @@ test('can do random access', async () => {
test('can get metadata-only packets', async () => {
const filePath = path.join(__dirname, '..', 'public/sample.flac');
const input = new Input({
using input = new Input({
source: new FilePathSource(filePath),
formats: ALL_FORMATS,
});
@@ -108,7 +108,7 @@ test('can get metadata-only packets', async () => {
test('can get metadata', async () => {
const filePath = path.join(__dirname, '..', 'public/sample.flac');
const input = new Input({
using input = new Input({
source: new FilePathSource(filePath),
formats: ALL_FORMATS,
});
@@ -145,7 +145,7 @@ test('can get metadata', async () => {
test('can re-mux a .flac', async () => {
const filePath = path.join(__dirname, '..', 'public/sample.flac');
const input = new Input({
using input = new Input({
source: new FilePathSource(filePath),
formats: ALL_FORMATS,
});
+10 -10
View File
@@ -107,7 +107,7 @@ test('Read and write metadata, MP4', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -156,7 +156,7 @@ test('Read and write metadata, QuickTime', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -187,7 +187,7 @@ test('Read and write metadata, QuickTime', async () => {
});
test('Read MOV metadata tags, ilst with keys', async () => {
const input = new Input({
using input = new Input({
source: new FilePathSource(path.join(__dirname, '../public/trunc-buck-bunny.mov')),
formats: ALL_FORMATS,
});
@@ -231,7 +231,7 @@ test('Read and write metadata, Matroska', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -294,7 +294,7 @@ test('Read and write metadata, MP3', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -346,7 +346,7 @@ test('Read and write metadata, Ogg', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -396,7 +396,7 @@ test('Read and write metadata, FLAC', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -445,7 +445,7 @@ test('Read and write metadata, WAVE', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -484,7 +484,7 @@ test('Conversion metadata tags, default case', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
@@ -534,7 +534,7 @@ test('Conversion metadata tags, modified', async () => {
await dummyTrack.addPacket();
await output.finalize();
const input = new Input({
using input = new Input({
source: new BufferSource(output.target.buffer!),
formats: ALL_FORMATS,
});
+1 -1
View File
@@ -6,7 +6,7 @@ const __dirname = new URL('.', import.meta.url).pathname;
test('Should be able to get packets from a .MP4 file', async () => {
const filePath = path.join(__dirname, '..', 'public/video.mp4');
const input = new Input({
using input = new Input({
source: new FilePathSource(filePath),
formats: ALL_FORMATS,
});