matches = name == opt_def.name;
}
if matches {
- let arg = if let Some(ref str) = opt.value { Some(str) } else { None };
+ 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);
if ret.is_err() { return false; }
let streamno = ret.unwrap();
- let sidx = if let Some(idx) = self.istr_opts.iter().position(|str| str.id == streamno) {
+ let sidx = if let Some(idx) = self.istr_opts.iter().position(|el| el.id == streamno) {
idx
} else {
self.istr_opts.push(InputStreamOptions {id: streamno, drop: false, dec_opts: Vec::new() });
if ret.is_err() { return false; }
let streamno = ret.unwrap();
- let sidx = if let Some(idx) = self.ostr_opts.iter().position(|str| str.id == streamno) {
+ let sidx = if let Some(idx) = self.ostr_opts.iter().position(|el| el.id == streamno) {
idx
} else {
self.ostr_opts.push(OutputStreamOptions {id: streamno, enc_name: String::new(), enc_params: EncodeParameters::default(), enc_opts: Vec::new() });
true
}
fn apply_decoder_options(&self, dec: &mut dyn NADecoder, str_id: u32) {
- if let Some(str_idx) = self.istr_opts.iter().position(|str| str.id == str_id) {
+ if let Some(str_idx) = self.istr_opts.iter().position(|el| el.id == str_id) {
let dec_opts = dec.get_supported_options();
if dec_opts.is_empty() { return; }
let name = format!("input stream {}", str_id);
}
fn register_output_stream(&mut self, cname: &str, istr: NAStreamRef, out_sm: &mut StreamManager, enc_reg: &RegisteredEncoders) -> bool {
let out_id = out_sm.get_num_streams() as u32;
- if let Some(str_idx) = self.istr_opts.iter().position(|str| str.id == (istr.get_num() as u32)) {
+ if let Some(str_idx) = self.istr_opts.iter().position(|el| el.id == (istr.get_num() as u32)) {
if self.istr_opts[str_idx].drop {
self.encoders.push(OutputMode::Drop);
return true;
}
}
- if let Some(str_idx) = self.ostr_opts.iter().position(|str| str.id == out_id) {
+ if let Some(str_idx) = self.ostr_opts.iter().position(|el| el.id == out_id) {
let oopts = &mut self.ostr_opts[str_idx];
if oopts.enc_name.as_str() == "copy" && (cname == "any" || istr.get_info().get_name() == cname) {
out_sm.add_stream_ref(istr);
}
}
- let output_fmt = if let Some(ref str) = transcoder.output_fmt {
- str
+ let output_fmt = if let Some(ref fmtname) = transcoder.output_fmt {
+ fmtname
} else if transcoder.output_name.as_str() == "/dev/null" {
"null"
- } else if let Some(str) = detect::detect_format_by_name(transcoder.output_name.as_str()) {
- str
+ } else if let Some(fmtname) = detect::detect_format_by_name(transcoder.output_name.as_str()) {
+ fmtname
} else {
println!("Cannot guess muxer for output");
return;
},
};
}
- 'reord_flush_loop: for str in dmx.get_streams() {
- let src_id = str.get_num();
+ 'reord_flush_loop: for stream in dmx.get_streams() {
+ let src_id = stream.get_num();
if let OutputMode::Encode(dst_id, ref mut encoder, ref mut cvt) = transcoder.encoders[src_id] {
if let Some((_, _, ref mut reorderer)) = transcoder.decoders[src_id] {
while let Some(frm) = reorderer.get_last_frames() {