mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 11:23:45 +02:00
Support AVC in Annex B format, add AVCDecoderConfigurationRecord extraction logic, add Annex B to AVCC converter, add support for Matroska Clusters with undefined size, & a couple other improvements
This commit is contained in:
@@ -69,6 +69,31 @@ export class Reader {
|
||||
this.insertIntoLoadedSegments(start, bytes);
|
||||
}
|
||||
|
||||
rangeIsLoaded(start: number, end: number) {
|
||||
if (end <= start) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const index = binarySearchLessOrEqual(this.loadedSegments, start, x => x.start);
|
||||
if (index === -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (let i = index; i < this.loadedSegments.length; i++) {
|
||||
const segment = this.loadedSegments[i]!;
|
||||
if (segment.start > start) {
|
||||
break;
|
||||
}
|
||||
|
||||
const segmentEncasesRequestedRange = segment.end >= end;
|
||||
if (segmentEncasesRequestedRange) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private insertIntoLoadedSegments(start: number, bytes: Uint8Array) {
|
||||
const segment: ReadSegment = {
|
||||
start,
|
||||
|
||||
Reference in New Issue
Block a user