mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 11:23:45 +02:00
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:
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user