Skip to content

Commit

Permalink
drop frames if AVAssetWriter not ready for more data
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Nov 21, 2024
1 parent d3220ac commit 9842913
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/media/src/encoders/h264_avassetwriter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ impl H264AVAssetWriterEncoder {
}

fn queue_frame(&mut self, frame: screencapturekit::cm_sample_buffer::CMSampleBuffer) {
if !self.video_input.is_ready_for_more_media_data() {
return;
}

let sample_buf = unsafe {
let ptr = &*frame.sys_ref as *const _ as *const cm::SampleBuf;
&*ptr
Expand Down

1 comment on commit 9842913

@vercel
Copy link

@vercel vercel bot commented on 9842913 Nov 21, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.