diff --git a/biome.json b/biome.json index e9d10fb..c1baa08 100644 --- a/biome.json +++ b/biome.json @@ -35,7 +35,8 @@ "suspicious": { "noUnknownAtRules": "off", "useIterableCallbackReturn": "off", - "noArrayIndexKey": "warn" + "noArrayIndexKey": "warn", + "noExplicitAny": "off" }, "a11y": { "useSemanticElements": "off", @@ -50,7 +51,10 @@ }, "correctness": { "noInvalidUseBeforeDeclaration": "off", - "noUnusedFunctionParameters": "warn" + "noUnusedFunctionParameters": "warn", + "noUnusedVariables": "warn", + "noUnusedImports": "warn", + "noUnusedPrivateClassMembers": "warn" } }, "domains": { diff --git a/services/discord-gateway/src/goLive/Demuxer.ts b/services/discord-gateway/src/goLive/Demuxer.ts index 159383c..8a8e6bc 100644 --- a/services/discord-gateway/src/goLive/Demuxer.ts +++ b/services/discord-gateway/src/goLive/Demuxer.ts @@ -231,12 +231,10 @@ export async function demux( console.log("[goLive:Demuxer] audio pipe wired (fd3 → Ogg Opus → aPipe)"); } - // Set true once stderr metadata has been parsed (see handler below). - let parsedMeta = false; // Track which stream kinds we've seen. We must NOT stop parsing on the // first stream found: ffmpeg can print the video line and audio line in // separate stderr chunks (input arrives slowly), and the old - // early-return (`if (parsedMeta) return`) dropped the audio line forever + // early-return dropped the audio line forever // → aInfo undefined → no audio RTP → static GoLive tile. let seenVideo = false; let seenAudio = false; @@ -345,7 +343,7 @@ export async function demux( // handler AFTER `return { audio: aInfo }` had already captured // `undefined` → no audio RTP → static GoLive tile even though the NUT // carried audio. Wait for BOTH kinds (when audio is expected). - if (seenVideo || seenAudio) parsedMeta = true; + // (parsedMeta removed — we now wait for both via allSeen() below.) }); } @@ -407,7 +405,10 @@ export async function demux( const now = Date.now(); const elapsed = now - lastToken; if (elapsed >= tokenIntervalMs) { - tokens = Math.min(videoFps, tokens + Math.floor(elapsed / tokenIntervalMs)); + tokens = Math.min( + videoFps, + tokens + Math.floor(elapsed / tokenIntervalMs), + ); lastToken = now - (elapsed % tokenIntervalMs); } if (tokens >= 1) {