mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-18 12:27:12 +00:00
13 lines
376 B
Rust
13 lines
376 B
Rust
use std::ffi::CStr;
|
|
|
|
use ffmpeg_sys_next::av_make_error_string;
|
|
|
|
|
|
pub fn get_ffmpeg_error_msg(ret: libc::c_int) -> String {
|
|
unsafe {
|
|
const BUF_SIZE: usize = 512;
|
|
let mut buf: [libc::c_char; BUF_SIZE] = [0; BUF_SIZE];
|
|
av_make_error_string(buf.as_mut_ptr(), BUF_SIZE, ret);
|
|
String::from(CStr::from_ptr(buf.as_ptr()).to_str().unwrap())
|
|
}
|
|
} |