From 6b80ea99a63338c72946b4793f6ef254e3724908 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Tue, 3 Sep 2024 17:56:28 +0000 Subject: [PATCH] web/webcodecs: close frames after we're done using them --- web/src/lib/libav/webcodecs.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/lib/libav/webcodecs.ts b/web/src/lib/libav/webcodecs.ts index ddb9ec82..e9d5e958 100644 --- a/web/src/lib/libav/webcodecs.ts +++ b/web/src/lib/libav/webcodecs.ts @@ -241,7 +241,8 @@ export default class WebCodecsWrapper { } } - return destination.encode(data); + destination.encode(data); + data.close(); } static encodeVideo(data: VideoFrame | LibAVPolyfill.VideoFrame, destination: VideoEncoder) { @@ -260,6 +261,7 @@ export default class WebCodecsWrapper { } } - return destination.encode(data as VideoFrame); + destination.encode(data as VideoFrame); + data.close(); } } \ No newline at end of file