From 92d9d7dc3904e46d7ed09a4a4839e30a73eecdbb Mon Sep 17 00:00:00 2001 From: Nghia Date: Thu, 14 Mar 2024 19:28:20 +0100 Subject: [PATCH] use c_char instead of i8 (#155) --- src/avutil/channel_layout.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/avutil/channel_layout.rs b/src/avutil/channel_layout.rs index d5a483d..6b6acc7 100644 --- a/src/avutil/channel_layout.rs +++ b/src/avutil/channel_layout.rs @@ -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 {