From d97f6de301d8b652442580746b92d466394baf83 Mon Sep 17 00:00:00 2001 From: tilpner Date: Mon, 6 Jun 2022 16:58:04 +0200 Subject: [PATCH] fix(examples): adjust transcode-x264 for Dictionary changes (9440621ff839f073e5ffb8b59b60cbf1011402d5) --- examples/transcode-x264.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/transcode-x264.rs b/examples/transcode-x264.rs index 035c86b..391a659 100644 --- a/examples/transcode-x264.rs +++ b/examples/transcode-x264.rs @@ -127,12 +127,14 @@ impl Transcoder { } } -fn parse_opts<'a>(s: String) -> Option> { +fn parse_opts<'a>(s: String) -> Option { let mut dict = Dictionary::new(); for keyval in s.split_terminator(',') { let tokens: Vec<&str> = keyval.split('=').collect(); match tokens[..] { - [key, val] => dict.set(key, val), + [key, val] => { + dict.set(key, val); + } _ => return None, } } @@ -145,7 +147,7 @@ fn main() { let x264_opts = parse_opts(env::args().nth(3).unwrap_or_else(|| DEFAULT_X264_OPTS.to_string())) .expect("invalid x264 options string"); - eprintln!("x264 options: {:?}", x264_opts); + eprintln!("x264 options: {:?}", &x264_opts); ffmpeg::init().unwrap(); @@ -176,7 +178,7 @@ fn main() { &ist, &mut octx, ost_index as _, - x264_opts.to_owned(), + x264_opts.clone(), Some(ist_index) == best_video_stream_index, ) .unwrap(),