mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-01 21:03:46 +02:00
Add AudioSampleCursor, make sample cursor error behavior more explicit, add sample mapping, and a bunch of extra shit I forgot
This commit is contained in:
+7
-1
@@ -6,6 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { SampleCursor } from './cursors';
|
||||
import { Demuxer } from './demuxer';
|
||||
import { InputFormat } from './input-format';
|
||||
import { assert, polyfillSymbolDispose } from './misc';
|
||||
@@ -44,6 +45,9 @@ export class Input<S extends Source = Source> implements Disposable {
|
||||
_reader: Reader;
|
||||
/** @internal */
|
||||
_disposed = false;
|
||||
/** @internal */
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
_openSampleCursors = new Set<SampleCursor<any>>();
|
||||
|
||||
/** True if the input has been disposed. */
|
||||
get disposed() {
|
||||
@@ -181,7 +185,9 @@ export class Input<S extends Source = Source> implements Disposable {
|
||||
this._source._disposed = true;
|
||||
this._source._dispose();
|
||||
|
||||
// TODO this should dispose cursors probably
|
||||
for (const cursor of [...this._openSampleCursors]) {
|
||||
void cursor.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user