@mediabunny/server 1.45.3 → 1.45.5
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/dist/bundles/mediabunny-server.cjs +19 -7
- package/dist/bundles/mediabunny-server.min.cjs +2 -2
- package/dist/bundles/mediabunny-server.min.mjs +2 -2
- package/dist/bundles/mediabunny-server.mjs +19 -7
- package/dist/modules/src/audio-decoder.d.ts +1 -1
- package/dist/modules/src/audio-decoder.d.ts.map +1 -1
- package/dist/modules/src/audio-decoder.js +8 -1
- package/dist/modules/src/audio-encoder.d.ts +3 -3
- package/dist/modules/src/audio-encoder.d.ts.map +1 -1
- package/dist/modules/src/audio-encoder.js +6 -2
- package/dist/modules/src/index.d.ts.map +1 -1
- package/dist/modules/src/index.js +4 -0
- package/dist/modules/src/video-decoder.d.ts.map +1 -1
- package/dist/modules/src/video-decoder.js +2 -1
- package/dist/modules/src/video-encoder.d.ts +3 -3
- package/dist/modules/src/video-encoder.d.ts.map +1 -1
- package/dist/modules/src/video-encoder.js +7 -3
- package/dist/modules/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/audio-decoder.ts +8 -2
- package/src/audio-encoder.ts +7 -3
- package/src/index.ts +4 -0
- package/src/video-decoder.ts +4 -1
- package/src/video-encoder.ts +11 -10
|
@@ -52,11 +52,11 @@ class NodeAvVideoEncoder extends mediabunny_1.CustomVideoEncoder {
|
|
|
52
52
|
constructor() {
|
|
53
53
|
super(...arguments);
|
|
54
54
|
this.codecContext = null;
|
|
55
|
+
this.scaler = null;
|
|
56
|
+
this.dstFrame = null;
|
|
55
57
|
this.lastBuffer = null;
|
|
56
58
|
this.packetEmitted = false;
|
|
57
|
-
this.scaler = null;
|
|
58
59
|
this.lastScalerKey = null;
|
|
59
|
-
this.dstFrame = null;
|
|
60
60
|
// Bookkeeping to restore the original timing information
|
|
61
61
|
this.preciseTimings = [];
|
|
62
62
|
}
|
|
@@ -164,9 +164,13 @@ class NodeAvVideoEncoder extends mediabunny_1.CustomVideoEncoder {
|
|
|
164
164
|
async encode(videoSample, options) {
|
|
165
165
|
if (this.codecContext === null) {
|
|
166
166
|
await this.createCodecContext();
|
|
167
|
-
(0, misc_2.assert)(this.codecContext);
|
|
168
167
|
}
|
|
168
|
+
(0, misc_2.assert)(this.codecContext);
|
|
169
169
|
if (videoSample._data instanceof video_sample_1.AvFrameVideoSampleResource) {
|
|
170
|
+
// Release any buffers still referenced from the previous encode before reffing the new frame, otherwise
|
|
171
|
+
// av_frame_ref leaks them
|
|
172
|
+
// https://github.com/Vanilagy/mediabunny/issues/392
|
|
173
|
+
this.frame.unref();
|
|
170
174
|
this.frame.ref(videoSample._data.frame);
|
|
171
175
|
}
|
|
172
176
|
else {
|