From e800beaaf5303a5971d0725a6b4de2c46b7e8dd5 Mon Sep 17 00:00:00 2001 From: gxz Date: Sat, 11 May 2024 17:10:19 +0800 Subject: [PATCH] chore: optimize --- ts/Renderer/WebCodecsRendererCache.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ts/Renderer/WebCodecsRendererCache.ts b/ts/Renderer/WebCodecsRendererCache.ts index 912a11255..a5bf7feef 100644 --- a/ts/Renderer/WebCodecsRendererCache.ts +++ b/ts/Renderer/WebCodecsRendererCache.ts @@ -76,6 +76,7 @@ export class WebCodecsRendererCache type: VideoStreamType.VideoStreamHigh, encodedFrameOnly: true, }); + this._engine?.getMediaEngine().registerVideoEncodedFrameObserver(this); } public shouldFallback(frameInfo: EncodedVideoFrameInfo): boolean { @@ -104,6 +105,7 @@ export class WebCodecsRendererCache public release(): void { logInfo('call_back_with_encoded_video_frame release'); + this._engine?.getMediaEngine().unregisterVideoEncodedFrameObserver(this); this._decoder?.release(); this._decoder = null; super.release();