Don't pass AsRef<T>
params by reference (#84)
This commit is contained in:
@ -5,7 +5,7 @@ use std::env;
|
||||
fn main() {
|
||||
ffmpeg::init().unwrap();
|
||||
|
||||
match ffmpeg::format::input(&env::args().nth(1).expect("missing input file name")) {
|
||||
match ffmpeg::format::input(env::args().nth(1).expect("missing input file name")) {
|
||||
Ok(ictx) => {
|
||||
println!("Nb chapters: {}", ictx.nb_chapters());
|
||||
|
||||
@ -20,7 +20,7 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
let mut octx = ffmpeg::format::output(&"test.mkv").expect("Couldn't open test file");
|
||||
let mut octx = ffmpeg::format::output("test.mkv").expect("Couldn't open test file");
|
||||
|
||||
for chapter in ictx.chapters() {
|
||||
let title = match chapter.metadata().get("title") {
|
||||
|
@ -11,7 +11,7 @@ use std::io::prelude::*;
|
||||
fn main() -> Result<(), ffmpeg::Error> {
|
||||
ffmpeg::init().unwrap();
|
||||
|
||||
if let Ok(mut ictx) = input(&env::args().nth(1).expect("Cannot open file.")) {
|
||||
if let Ok(mut ictx) = input(env::args().nth(1).expect("Cannot open file.")) {
|
||||
let input = ictx
|
||||
.streams()
|
||||
.best(Type::Video)
|
||||
|
@ -5,7 +5,7 @@ use std::env;
|
||||
fn main() -> Result<(), ffmpeg::Error> {
|
||||
ffmpeg::init().unwrap();
|
||||
|
||||
match ffmpeg::format::input(&env::args().nth(1).expect("missing file")) {
|
||||
match ffmpeg::format::input(env::args().nth(1).expect("missing file")) {
|
||||
Ok(context) => {
|
||||
for (k, v) in context.metadata().iter() {
|
||||
println!("{k}: {v}");
|
||||
|
@ -72,7 +72,7 @@ struct Transcoder {
|
||||
fn transcoder<P: AsRef<Path>>(
|
||||
ictx: &mut format::context::Input,
|
||||
octx: &mut format::context::Output,
|
||||
path: &P,
|
||||
path: P,
|
||||
filter_spec: &str,
|
||||
) -> Result<Transcoder, ffmpeg::Error> {
|
||||
let input = ictx
|
||||
|
Reference in New Issue
Block a user