Skip to content

fix: end a recording cleanly when its writer thread throws - #491

Merged
devopvoid merged 1 commit into
mainfrom
fix/recorder-writer-exceptions
Oct 31, 2026
Merged

devopvoid merged 1 commit into
mainfrom
fix/recorder-writer-exceptions

Conversation

@devopvoid

Copy link
Copy Markdown
Owner

An exception leaving MediaRecorder::Run(), such as std::bad_alloc from pending_.push_back() or extradata_.assign(), ended the whole process.

  • Run() catches what the writer loop throws. The recording then fails, drops what is queued, reports onError once (the out-of-memory message is made in advance) and finishes the file, so it ends as PARTIAL or FAILED.
  • RecorderTrack::ExtractExtradata frees its bitstream filter and packet by RAII.
  • AllocationFault.failWriterAllocation() injects the fault on the writer thread, with tests before and after the header.

An exception leaving MediaRecorder::Run() ended the process. The writer now fails the recording, drops what is queued, reports onError and finishes the file. ExtractExtradata frees its filter and packet by RAII.
@devopvoid
devopvoid merged commit 9810791 into main Oct 31, 2026
17 of 19 checks passed
@devopvoid
devopvoid deleted the fix/recorder-writer-exceptions branch October 31, 2026 00:10
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.

1 participant