mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
fix(codec): use a *const pointer
This commit is contained in:
+2
-6
@@ -5,22 +5,18 @@ use crate::{ffi::*, media, Error};
|
||||
|
||||
#[derive(PartialEq, Eq, Copy, Clone)]
|
||||
pub struct Codec {
|
||||
ptr: *mut AVCodec,
|
||||
ptr: *const AVCodec,
|
||||
}
|
||||
|
||||
unsafe impl Send for Codec {}
|
||||
unsafe impl Sync for Codec {}
|
||||
|
||||
impl Codec {
|
||||
pub unsafe fn wrap(ptr: *mut AVCodec) -> Self {
|
||||
pub unsafe fn wrap(ptr: *const AVCodec) -> Self {
|
||||
Codec { ptr }
|
||||
}
|
||||
|
||||
pub unsafe fn as_ptr(&self) -> *const AVCodec {
|
||||
self.ptr as *const _
|
||||
}
|
||||
|
||||
pub unsafe fn as_mut_ptr(&mut self) -> *mut AVCodec {
|
||||
self.ptr
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,13 +172,13 @@ impl<'a> Best<'a> {
|
||||
'a: 'b,
|
||||
{
|
||||
unsafe {
|
||||
let mut decoder = ptr::null_mut();
|
||||
let mut decoder = ptr::null::<AVCodec>();
|
||||
let index = av_find_best_stream(
|
||||
self.context.ptr,
|
||||
kind.into(),
|
||||
self.wanted as c_int,
|
||||
self.related as c_int,
|
||||
&mut decoder,
|
||||
&mut decoder as *mut _,
|
||||
0,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user