larksuite / rsmpeg

A Rust crate that exposes FFmpeg's power as much as possible.
https://docs.rs/rsmpeg/latest/rsmpeg/
MIT License
677 stars 41 forks source link

non-primitive cast: `unsafe extern "C" #178

Closed lantq1979 closed 2 months ago

lantq1979 commented 7 months ago

error[E0605]: non-primitive cast: unsafe extern "C" fn(*mut c_void, *const u8, i32) -> i32 {write_c} as unsafe extern "C" fn(*mut c_void, *mut u8, i32) -> i32

rsmpeg-0.15.0+ffmpeg.7.0\src\avformat\avio.rs:125:51 | 125 | write_packet.is_some().then_some( writec as ), //writec as | ^^^^^^^^^^^^ invalid cast

ldm0 commented 7 months ago

You can check the comment above: https://github.com/larksuite/rsmpeg/blob/master/src/avformat/avio.rs#L124

It seems that you are using FFmpeg 6.*. Please import rsmpeg like this:

rsmpeg = { version = "0.15.0", default-features = false, features = ["ffmpeg6"] }