Skip to content

Commit

Permalink
use c_char instead of i8
Browse files Browse the repository at this point in the history
  • Loading branch information
vnghia committed Mar 14, 2024
1 parent 58d143d commit aa5e36d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/avutil/channel_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,22 @@ impl AVChannelLayout {

// # Safety: `as usize` after upgrading, len is assumed to be positive.
let len = unsafe {
ffi::av_channel_layout_describe(self.as_ptr(), buf.as_mut_ptr() as *mut i8, BUF_SIZE)
ffi::av_channel_layout_describe(
self.as_ptr(),
buf.as_mut_ptr() as *mut std::ffi::c_char,
BUF_SIZE,
)
}
.upgrade()? as usize;

let len = if len > BUF_SIZE {
buf.resize(len, 0);
unsafe {
ffi::av_channel_layout_describe(self.as_ptr(), buf.as_mut_ptr() as *mut i8, len)
ffi::av_channel_layout_describe(
self.as_ptr(),
buf.as_mut_ptr() as *mut std::ffi::c_char,
len,
)
}
.upgrade()? as usize
} else {
Expand Down

0 comments on commit aa5e36d

Please sign in to comment.