}
}
$obj.set_options(opts.as_slice());
+ };
+ (ignerr; $obj: expr, $in_opts: expr, $name: expr) => {
+ let mut opts = Vec::with_capacity($in_opts.len());
+ let opt_def = $obj.get_supported_options();
+ for opt in $in_opts.iter() {
+ for opt_def in opt_def.iter() {
+ let mut matches = opt.name == opt_def.name;
+ if !matches && opt.name.starts_with("no") {
+ let (_, name) = opt.name.split_at(2);
+ matches = name == opt_def.name;
+ }
+ if matches {
+ let arg = if let Some(ref strval) = opt.value { Some(strval) } else { None };
+ let ret = opt_def.parse(&opt.name, arg);
+ if let Ok((val, _)) = ret {
+ opts.push(val);
+ }
+ }
+ }
+ }
+ $obj.set_options(opts.as_slice());
}
}
return None;
}
- parse_and_apply_options!(encoder, &oopts.enc_opts, name);
+ parse_and_apply_options!(ignerr; encoder, &oopts.enc_opts, name);
let enc_stream = ret.unwrap();
let real_fmt = enc_stream.get_info().get_properties();