fix: mux build ff_api*

This commit is contained in:
kieran 2024-12-11 10:44:17 +00:00
parent df69b2f05d
commit b358b3e420
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -10,13 +10,17 @@ use ffmpeg_sys_the_third::{
}; };
use slimbox::{slimbox_unsize, SlimBox, SlimMut}; use slimbox::{slimbox_unsize, SlimBox, SlimMut};
use std::collections::HashMap; use std::collections::HashMap;
use std::io::{Read, Seek, SeekFrom, Write}; use std::io::{Seek, SeekFrom, Write};
use std::{ptr, slice}; use std::{ptr, slice};
#[cfg(feature = "ff_api_avio_write_nonconst")]
type WriteDataPtr = *mut u8;
#[cfg(not(feature = "ff_api_avio_write_nonconst"))]
type WriteDataPtr = *const u8;
unsafe extern "C" fn write_data<T>( unsafe extern "C" fn write_data<T>(
opaque: *mut libc::c_void, opaque: *mut libc::c_void,
#[cfg(feature = "avformat_version_greater_than_60_12")] buffer: *const u8, buffer: WriteDataPtr,
#[cfg(not(feature = "avformat_version_greater_than_60_12"))] buffer: *mut u8,
size: libc::c_int, size: libc::c_int,
) -> libc::c_int ) -> libc::c_int
where where
@ -392,7 +396,7 @@ impl Muxer {
impl Drop for Muxer { impl Drop for Muxer {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { unsafe {
self.free_ctx(); self.free_ctx().expect("drop muxer");
} }
} }
} }