mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-01 12:53:49 +02:00
Fix sample index retrieval case
This commit is contained in:
@@ -392,7 +392,7 @@ export class IsobmffDemuxer extends Demuxer {
|
|||||||
// If they're not defined, we can simply use the decode timestamps as presentation timestamps
|
// If they're not defined, we can simply use the decode timestamps as presentation timestamps
|
||||||
}
|
}
|
||||||
|
|
||||||
return internalTrack.sampleTable;
|
return sampleTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
async readFragment(): Promise<Fragment> {
|
async readFragment(): Promise<Fragment> {
|
||||||
@@ -2239,7 +2239,8 @@ const getSampleIndexForTimestamp = (sampleTable: SampleTable, timescaleUnits: nu
|
|||||||
}
|
}
|
||||||
|
|
||||||
const entry = sampleTable.sampleTimingEntries[index]!;
|
const entry = sampleTable.sampleTimingEntries[index]!;
|
||||||
return entry.startIndex + Math.floor((timescaleUnits - entry.startDecodeTimestamp) / entry.delta);
|
return entry.startIndex
|
||||||
|
+ Math.min(Math.floor((timescaleUnits - entry.startDecodeTimestamp) / entry.delta), entry.count - 1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,5 @@
|
|||||||
- Add the new audio codecs to muxers
|
- Add the new audio codecs to muxers
|
||||||
- Mov muxer!!! Only mov can hold PCM audio, MP4 cannot
|
- Mov muxer!!! Only mov can hold PCM audio, MP4 cannot
|
||||||
- Metadata methods for computing average fps and bitrate
|
- Metadata methods for computing average fps and bitrate
|
||||||
- A stream source?? Or like a callback-driven source
|
- A stream source?? Or like a callback-driven source
|
||||||
|
- onRead callback for Source
|
||||||
Reference in New Issue
Block a user