Fix transcode-x264 example

This commit is contained in:
redzic
2021-09-04 12:51:04 -05:00
parent ede94236d0
commit d0f9f25f01
+5 -4
View File
@@ -138,12 +138,14 @@ impl Transcoder {
}
}
fn parse_opts<'a>(s: String) -> Option<Dictionary<'a>> {
fn parse_opts<'a>(s: String) -> Option<Dictionary> {
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,
}
}
@@ -202,8 +204,7 @@ fn main() {
)
.unwrap(),
);
}
else {
} else {
// Set up for stream copy for non-video stream.
let mut ost = octx.add_stream(encoder::find(codec::Id::None)).unwrap();
ost.set_parameters(ist.parameters());