mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-01 21:03:46 +02:00
Add InputTrack.number
This commit is contained in:
@@ -428,6 +428,16 @@ class OggAudioTrackBacking implements InputAudioTrackBacking {
|
||||
return this.bitstream.serialNumber;
|
||||
}
|
||||
|
||||
getNumber() {
|
||||
// All Ogg tracks are audio, so the track's index + 1 is its number
|
||||
const index = this.demuxer.tracks.findIndex(
|
||||
t => (t._backing as OggAudioTrackBacking).bitstream === this.bitstream,
|
||||
);
|
||||
assert(index !== -1);
|
||||
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
getNumberOfChannels() {
|
||||
return this.bitstream.numberOfChannels;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user