Fix SourceRef race conditions, fix "source" and "target" getter returning unused instances, add missing validation, make "getDurationFromMetadata" only exist on tracks, fix examples, expand media player to support live playback, change the signatures of some Input APIs

This commit is contained in:
Vanilagy
2026-04-10 13:38:14 +02:00
parent 0813bcab28
commit aa810fc433
24 changed files with 493 additions and 476 deletions
+2 -2
View File
@@ -207,11 +207,11 @@ export class SourceRef<S extends Source = Source> implements Disposable {
/**
* Frees the ref, decrementing the source's internal reference count. If the source's internal reference count
* reaches zero, it gets disposed. This method is idempotent.
* reaches zero, it gets disposed. To catch bugs, this method throws if the ref is already freed.
*/
free() {
if (this._freed) {
return;
throw new Error('Illegal operation: double free on SourceRef.');
}
const source = this.source;