Remove InputTrack.groupId, hide pairing mask, change HLS track merging behavior

This commit is contained in:
Vanilagy
2026-03-24 21:54:00 +01:00
parent 3e87d747e6
commit 157582498f
14 changed files with 148 additions and 248 deletions
+5 -12
View File
@@ -41,7 +41,6 @@ export interface InputTrackBacking {
getTimeResolution(): number;
getTimestampsAreRelativeToUnixEpoch(): boolean;
getDisposition(): TrackDisposition;
getGroupId(): number;
getPairingMask(): bigint;
getBitrate(): number | null;
getAverageBitrate(): number | null;
@@ -118,14 +117,6 @@ export abstract class InputTrack {
return this._backing.getNumber();
}
get groupId() {
return this._backing.getGroupId();
}
get pairingMask() {
return this._backing.getPairingMask();
}
/**
* The identifier of the codec used internally by the container. It is not homogenized by Mediabunny
* and depends entirely on the container format.
@@ -310,9 +301,11 @@ export abstract class InputTrack {
return true;
}
return this.input === otherTrack.input
&& this.groupId !== otherTrack.groupId // This also prevents the track from being paired with itself
&& (this.pairingMask & otherTrack.pairingMask) !== 0n;
if (this.input !== otherTrack.input || this === otherTrack) {
return false;
}
return (this._backing.getPairingMask() & otherTrack._backing.getPairingMask()) !== 0n;
}
async getPairableTracks(query?: TrackQuery<InputTrack>) {