fix(rendering): open recordings with an unreadable mic track - #2075
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
|
hey @greptileai, please re-review the PR |
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
The PR allows recordings with unreadable microphone tracks to open by treating those tracks as absent while retaining strict export behavior.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(mobile): bump react-native to expo-e..." | Re-trigger Greptile