Skip to content

🎥 Make videos programmatically with React

`@remotion/media-utils`: Fix overfetching of `useWindowedAudioData()`

JonnyBurgerd4242c5d1d4f
diff --git a/packages/media-utils/src/use-windowed-audio-data.ts b/packages/media-utils/src/use-windowed-audio-data.ts
index 0078cc8063..7f7c6e1f67 100644
--- a/packages/media-utils/src/use-windowed-audio-data.ts
+++ b/packages/media-utils/src/use-windowed-audio-data.ts
@@ -307,7 +307,8 @@ export const useWindowedAudioData = ({
// Only fetch windows that don't already exist
const windowsToActuallyFetch = windowsToFetch.filter(
- (windowIndex) => !waveFormMap[windowIndex],
+ (windowIndex) =>
+ !waveFormMap[windowIndex] && !requests.current[windowIndex],
);
if (windowsToActuallyFetch.length === 0) {