Skip to content

Commit

Permalink
Fix README and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm0 committed Jul 28, 2023
1 parent 5ee51db commit d543bc8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use std::error::Error;
use rsmpeg::avformat::AVFormatContextInput;

fn dump_av_info(path: &CStr) -> Result<(), Box<dyn Error>> {
let mut input_format_context = AVFormatContextInput::open(path)?;
let mut input_format_context = AVFormatContextInput::open(path, None)?;
input_format_context.dump(0, path)?;
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion src/avformat/avformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl AVFormatContextInput {
ffi::avformat_open_input(
&mut input_format_context,
url.as_ptr(),
fmt.map(|x| x.as_ptr()).unwrap_or_else(|| std::ptr::null()),
fmt.map(|x| x.as_ptr()).unwrap_or_else(std::ptr::null),
ptr::null_mut(),
)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn metadata(file: &str) -> Result<Vec<(String, String)>> {
result.push(("image_path".into(), file.to_string()));

let file = CString::new(file).unwrap();
let input_format_context = AVFormatContextInput::open(&file).unwrap();
let input_format_context = AVFormatContextInput::open(&file, None).unwrap();

// Get `duration` and `bit_rate` from `input_format_context`.
result.push(("duration".into(), input_format_context.duration.to_string()));
Expand Down

0 comments on commit d543bc8

Please sign in to comment.