Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/codec/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn new() -> Decoder {

pub fn find(id: Id) -> Option<Codec> {
unsafe {
let ptr = avcodec_find_decoder(id.into()) as *mut AVCodec;
let ptr = avcodec_find_decoder(id.into());

if ptr.is_null() {
None
Expand All @@ -47,7 +47,7 @@ pub fn find(id: Id) -> Option<Codec> {
pub fn find_by_name(name: &str) -> Option<Codec> {
unsafe {
let name = CString::new(name).unwrap();
let ptr = avcodec_find_decoder_by_name(name.as_ptr()) as *mut AVCodec;
let ptr = avcodec_find_decoder_by_name(name.as_ptr());

if ptr.is_null() {
None
Expand Down
4 changes: 2 additions & 2 deletions src/codec/encoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn new() -> Encoder {

pub fn find(id: Id) -> Option<Codec> {
unsafe {
let ptr = avcodec_find_encoder(id.into()) as *mut AVCodec;
let ptr = avcodec_find_encoder(id.into());

if ptr.is_null() {
None
Expand All @@ -50,7 +50,7 @@ pub fn find(id: Id) -> Option<Codec> {
pub fn find_by_name(name: &str) -> Option<Codec> {
unsafe {
let name = CString::new(name).unwrap();
let ptr = avcodec_find_encoder_by_name(name.as_ptr()) as *mut AVCodec;
let ptr = avcodec_find_encoder_by_name(name.as_ptr());

if ptr.is_null() {
None
Expand Down
4 changes: 2 additions & 2 deletions src/device/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ impl Iterator for AudioIter {

fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe {
let ptr = av_input_audio_device_next(self.0) as *mut AVInputFormat;
let ptr = av_input_audio_device_next(self.0);

if ptr.is_null() && !self.0.is_null() {
None
Expand All @@ -35,7 +35,7 @@ impl Iterator for VideoIter {

fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe {
let ptr = av_input_video_device_next(self.0) as *mut AVInputFormat;
let ptr = av_input_video_device_next(self.0);

if ptr.is_null() && !self.0.is_null() {
None
Expand Down
8 changes: 4 additions & 4 deletions src/device/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ impl Iterator for AudioIter {

fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe {
let ptr = av_output_audio_device_next(self.0) as *mut AVOutputFormat;
let ptr = av_output_audio_device_next(self.0);

if ptr.is_null() && !self.0.is_null() {
None
} else {
self.0 = ptr as *mut AVOutputFormat;
self.0 = ptr;

Some(Format::Output(format::Output::wrap(ptr)))
}
Expand All @@ -35,12 +35,12 @@ impl Iterator for VideoIter {

fn next(&mut self) -> Option<<Self as Iterator>::Item> {
unsafe {
let ptr = av_output_video_device_next(self.0) as *mut AVOutputFormat;
let ptr = av_output_video_device_next(self.0);

if ptr.is_null() && !self.0.is_null() {
None
} else {
self.0 = ptr as *mut AVOutputFormat;
self.0 = ptr;

Some(Format::Output(format::Output::wrap(ptr)))
}
Expand Down
2 changes: 1 addition & 1 deletion src/format/context/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Input {

impl Input {
pub fn format(&self) -> format::Input {
unsafe { format::Input::wrap((*self.as_ptr()).iformat as *mut AVInputFormat) }
unsafe { format::Input::wrap((*self.as_ptr()).iformat) }
}

#[cfg(not(feature = "ffmpeg_5_0"))]
Expand Down
2 changes: 1 addition & 1 deletion src/format/context/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Output {

impl Output {
pub fn format(&self) -> format::Output {
unsafe { format::Output::wrap((*self.as_ptr()).oformat as *mut AVOutputFormat) }
unsafe { format::Output::wrap((*self.as_ptr()).oformat) }
}

pub fn write_header(&mut self) -> Result<(), Error> {
Expand Down
2 changes: 1 addition & 1 deletion src/software/scaling/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Context {
(*input.as_ptr()).linesize.as_ptr() as *const _,
0,
self.input.height as c_int,
(*output.as_mut_ptr()).data.as_ptr() as *const *mut _,
(*output.as_mut_ptr()).data.as_ptr(),
(*output.as_mut_ptr()).linesize.as_ptr() as *mut _,
);
}
Expand Down