summaryrefslogtreecommitdiff
path: root/apps/web/src/lib/project/fps.ts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/lib/project/fps.ts')
-rw-r--r--apps/web/src/lib/project/fps.ts39
1 files changed, 0 insertions, 39 deletions
diff --git a/apps/web/src/lib/project/fps.ts b/apps/web/src/lib/project/fps.ts
deleted file mode 100644
index f031d348..00000000
--- a/apps/web/src/lib/project/fps.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import type { MediaAsset } from "@/lib/media/types";
-
-type MediaAssetFpsInput = Pick<MediaAsset, "type" | "fps">;
-
-export function getHighestImportedVideoFps({
- mediaAssets,
-}: {
- mediaAssets: MediaAssetFpsInput[];
-}): number | null {
- let highestFps: number | null = null;
-
- for (const asset of mediaAssets) {
- const fps = asset.fps ?? Number.NaN;
- if (asset.type !== "video") continue;
- if (!Number.isFinite(fps) || fps <= 0) continue;
-
- highestFps = highestFps === null ? fps : Math.max(highestFps, fps);
- }
-
- return highestFps;
-}
-
-export function getRaisedProjectFpsForImportedMedia({
- currentFps,
- importedAssets,
-}: {
- currentFps: number;
- importedAssets: MediaAssetFpsInput[];
-}): number | null {
- const highestImportedVideoFps = getHighestImportedVideoFps({
- mediaAssets: importedAssets,
- });
-
- if (highestImportedVideoFps === null || highestImportedVideoFps <= currentFps) {
- return null;
- }
-
- return highestImportedVideoFps;
-}