Skip to content

Commit

Permalink
simplify sample_buffer code a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Aug 16, 2024
1 parent cff24c0 commit 6ff00ea
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions macos/video-toolbox/src/compression_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ impl<C: Send> CompressionSession<C> {
let frame_context = *Box::<C>::from_raw(source_frame_ref_con as *mut C);
if let Some(frames) = ctx.frames.as_ref() {
let r = frames.try_send(result(status.into()).map(|_| CompressionSessionOutputFrame {
sample_buffer: if sample_buffer.is_null() {
None
} else {
Some(SampleBuffer::from_get_rule(sample_buffer as _))
},
sample_buffer: (!sample_buffer.is_null()).then(|| SampleBuffer::from_get_rule(sample_buffer as _)),
context: frame_context,
}));
if r.is_err() {
Expand Down

0 comments on commit 6ff00ea

Please sign in to comment.