From aa5e36d9b9e790f39604f6382f4d3c1cbbc9c0d3 Mon Sep 17 00:00:00 2001 From: Vo Van Nghia Date: Thu, 14 Mar 2024 14:13:06 +0100 Subject: [PATCH] use c_char instead of i8 --- 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 {