Skip to content

fix: handle InputDisposedError in useWindowedAudioData to ensure prop…#6910

Merged
JonnyBurger merged 1 commit intoremotion-dev:mainfrom
akashcorex:fix/input-disposed-error
Mar 26, 2026
Merged

fix: handle InputDisposedError in useWindowedAudioData to ensure prop…#6910
JonnyBurger merged 1 commit intoremotion-dev:mainfrom
akashcorex:fix/input-disposed-error

Conversation

@akashcorex
Copy link
Copy Markdown
Contributor

When the src changes, or the component unmounts, the metadata AbortController disposes the mediabunny Input while computeDuration() may still be running. That correctly throws InputDisposedError, but the catch path called cancelRender(err), which rethrows and produced an unhandled rejection because fetchMetadata is not awaited.

Treat InputDisposedError like the waveform path and useMaxMediaDuration: call continueRender(handle) and return; keep cancelRender for real failures.

Fixes #6894.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Mar 26, 2026 5:03am
remotion Ready Ready Preview, Comment Mar 26, 2026 5:03am

Request Review

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is correct and consistent with the existing InputDisposedError handling elsewhere in the codebase (useMaxMediaDuration, fetchAndSetWaveformData, extract-frames.ts). Calling continueRender(handle) to release the delay render handle before returning is the right approach — and double-calling it (once from the abort listener, once from this catch) is safe since continueRenderInternal is idempotent.

Pullfrog  | View workflow run | Using Big Pickle (free) | 𝕏

@JonnyBurger
Copy link
Copy Markdown
Member

Thanks!

@JonnyBurger JonnyBurger merged commit 6ebe7d9 into remotion-dev:main Mar 26, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputDisposedError: Input has been disposed in useWindowedAudioData

2 participants