codec/decoder: implement DerefMut
This commit is contained in:
parent
3b3f633c39
commit
5803c023ec
@ -18,7 +18,7 @@ pub use self::check::Check;
|
||||
use std::ffi::CString;
|
||||
use std::ptr;
|
||||
use std::slice::from_raw_parts;
|
||||
use std::ops::Deref;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
|
||||
use ffi::*;
|
||||
use super::{Id, Profile};
|
||||
@ -113,6 +113,12 @@ impl Deref for Decoder {
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for Decoder {
|
||||
fn deref_mut(&mut self) -> &mut<Self as Deref>::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
pub fn find(id: Id) -> Option<Codec<'static>> {
|
||||
unsafe {
|
||||
let ptr = avcodec_find_decoder(id.into());
|
||||
|
Loading…
x
Reference in New Issue
Block a user