fix(rendering): open recordings with an unreadable mic track - #2075
Open
richiemcilroy wants to merge 2 commits into
Open
fix(rendering): open recordings with an unreadable mic track#2075richiemcilroy wants to merge 2 commits into
richiemcilroy wants to merge 2 commits into
Conversation
…ty input Regression tests for the studio mic path (OpusEncoder into OggFile): 5s of 96kHz mono input must land on disk with the right duration, input shorter than one opus frame must be flushed at finish rather than dropped, and a track that never received a frame must still write container header pages instead of a 0-byte file.
An unreadable or empty mic file failed the entire recording open with "segment N / mic / Failed to open audio" even when display and camera decode fine, and the single-segment path panicked outright. Degrade the mic to no-audio with a warning instead, matching the system-audio handling from fbc8755 and playback's existing loaded_track behavior. Export still validates audio strictly so a track is never silently dropped from a deliverable.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Investigating #2069 (claimed 0-byte
audio-input.oggfiles in studio mode) showed the reported mechanism cannot occur, but it surfaced a real robustness gap: the editor refused to open an entire recording when the mic track is unreadable, even though the display and camera tracks decode fine. The single-segment path even panicked.Changes
crates/rendering/src/project_recordings.rs: an unreadable mic file now degrades to "no mic audio" with a warning instead of failing (or panicking on) the recording open. This mirrors the existing system-audio handling from fbc8755 and matches playback, which already degrades a broken mic track inloaded_track. Export is untouched and keeps failing loudly rather than silently dropping a track.crates/enc-ffmpeg/src/mux/ogg.rs: regression tests pinning theOggFile/OpusEncoderpath the issue claimed was broken: 5s of 96kHz mono input produces a playable file of the right duration, sub-frame input is flushed at finish rather than dropped, and a zero-frame track still writes container header pages instead of a 0-byte file.Verification
cargo test -p cap-enc-ffmpeg: all 49 tests pass, including the 3 new ones.cargo check -p cap-rendering -p cap-editor -p cap-exportclean; clippy clean for the touched code.segment-0/audio-input.oggto 0 bytes. Before this change the open fails with "segment 0 / mic / Failed to open audio: End of file"; after it, the recording opens and renders frame 0, with a warning logged.Greptile Summary
This PR makes editor rendering tolerate unreadable microphone tracks while preserving strict audio validation during export.
Confidence Score: 5/5
The PR appears safe to merge with no actionable defects identified.
The editor now degrades only the optional microphone metadata track when loading fails, while required display media and export-time audio validation retain their existing failure behavior; the added encoder tests align with the current Ogg and Opus lifecycle.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(rendering): open recordings with an ..." | Re-trigger Greptile
Context used: