mirror of
https://github.com/Vencord/Vesktop.git
synced 2026-11-28 12:56:23 -08:00
Works around a Chromium bug. Moves the SPS and PPS before the IDR slice when a hardware encoder emits them at the end of a keyframe. Apply the correction before Discord encrypts outgoing video. Assisted-by: GPT-6.2 Astra
21 lines
619 B
TypeScript
21 lines
619 B
TypeScript
import { readFile } from "fs/promises";
|
|
import { resolve } from "path";
|
|
|
|
import type { Plugin } from "esbuild";
|
|
|
|
export const fileImportPlugin: Plugin = {
|
|
name: "file-import",
|
|
setup(build) {
|
|
build.onResolve({ filter: /^file:\/\// }, ({ path, resolveDir }) => ({
|
|
path: resolve(resolveDir, path.slice("file://".length)),
|
|
namespace: "file-import"
|
|
}));
|
|
|
|
build.onLoad({ filter: /.*/, namespace: "file-import" }, async ({ path }) => ({
|
|
contents: await readFile(path, "utf8"),
|
|
loader: "text",
|
|
watchFiles: [path]
|
|
}));
|
|
}
|
|
};
|