mediabunny 1.50.5 → 1.50.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -8
- package/dist/bundles/mediabunny.cjs +8 -2
- package/dist/bundles/mediabunny.min.cjs +2 -2
- package/dist/bundles/mediabunny.min.mjs +2 -2
- package/dist/bundles/mediabunny.mjs +8 -2
- package/dist/bundles/mediabunny.node.cjs +8 -2
- package/dist/modules/src/media-sink.d.ts.map +1 -1
- package/dist/modules/src/media-sink.js +12 -4
- package/dist/modules/src/resample.js +1 -1
- package/dist/modules/src/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/media-sink.ts +11 -4
- package/src/resample.ts +1 -1
package/README.md
CHANGED
|
@@ -44,14 +44,6 @@ Mediabunny is a JavaScript library for reading, writing, and converting media (l
|
|
|
44
44
|
</a>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
|
-
### Silver sponsors
|
|
48
|
-
|
|
49
|
-
<div align="center">
|
|
50
|
-
<a href="https://ponder.ai/" target="_blank" rel="sponsored">
|
|
51
|
-
<img src="./docs/public/sponsors/ponder.png" width="50" height="50" alt="Ponder">
|
|
52
|
-
</a>
|
|
53
|
-
</div>
|
|
54
|
-
|
|
55
47
|
### Bronze sponsors
|
|
56
48
|
|
|
57
49
|
<div align="center">
|
|
@@ -22622,10 +22622,16 @@ var Mediabunny = (() => {
|
|
|
22622
22622
|
if (isChromium() && this.currentPacketIndex === 0) {
|
|
22623
22623
|
if (this.codec === "avc") {
|
|
22624
22624
|
const filteredNalUnits = [];
|
|
22625
|
+
let hasFrameData = false;
|
|
22625
22626
|
for (const loc of iterateAvcNalUnits(packet.data, this.decoderConfig)) {
|
|
22626
22627
|
const type = extractNalUnitTypeForAvc(packet.data[loc.offset]);
|
|
22628
|
+
hasFrameData ||= type >= 1 && type <= 5;
|
|
22627
22629
|
if (type === 9 /* AUD */) {
|
|
22628
|
-
|
|
22630
|
+
if (hasFrameData) {
|
|
22631
|
+
break;
|
|
22632
|
+
} else {
|
|
22633
|
+
filteredNalUnits.length = 0;
|
|
22634
|
+
}
|
|
22629
22635
|
}
|
|
22630
22636
|
if (!(type >= 20 && type <= 31)) {
|
|
22631
22637
|
filteredNalUnits.push(packet.data.subarray(loc.offset, loc.offset + loc.length));
|
|
@@ -32417,7 +32423,7 @@ ${cue.notes ?? ""}`;
|
|
|
32417
32423
|
audioSample.copyTo(sourceView, { planeIndex: 0, format: "f32" });
|
|
32418
32424
|
const inputStartTime = audioSample.timestamp - this.startTime;
|
|
32419
32425
|
const inputEndTime = inputStartTime + audioSample.duration;
|
|
32420
|
-
const outputStartFrame = Math.floor(inputStartTime * this.targetSampleRate);
|
|
32426
|
+
const outputStartFrame = Math.floor((inputStartTime - 1 / this.sourceSampleRate) * this.targetSampleRate) + 1;
|
|
32421
32427
|
const outputEndFrame = Math.ceil(inputEndTime * this.targetSampleRate);
|
|
32422
32428
|
for (let outputFrame = outputStartFrame; outputFrame < outputEndFrame; outputFrame++) {
|
|
32423
32429
|
if (outputFrame < this.bufferStartFrame) {
|