From: Kostya Shishkov Date: Tue, 9 Jun 2020 08:21:50 +0000 (+0200) Subject: fix stream copy mode X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=a7b5f0087c3e7c631902f911dc5c6f6190f3887e;p=nihav-encoder.git fix stream copy mode --- diff --git a/src/main.rs b/src/main.rs index 08aab6b..9e2bd88 100644 --- a/src/main.rs +++ b/src/main.rs @@ -350,7 +350,8 @@ impl Transcoder { if let Some(str_idx) = self.ostr_opts.iter().position(|str| str.id == out_id) { let oopts = &mut self.ostr_opts[str_idx]; - if cname == "copy" && istr.get_info().get_name() == cname { + if oopts.enc_name.as_str() == "copy" && (cname == "any" || istr.get_info().get_name() == cname) { + out_sm.add_stream_ref(istr.clone()); self.encoders.push(OutputMode::Copy(out_id)); } else if cname == "any" || oopts.enc_name.as_str() == cname { let enc_create = enc_reg.find_encoder(oopts.enc_name.as_str()); @@ -430,6 +431,7 @@ println!("encoder {} is not supported by output (expected {})", istr.id, istr.ge } } else { if cname == "any" || istr.get_info().get_name() == cname { + out_sm.add_stream_ref(istr.clone()); self.encoders.push(OutputMode::Copy(out_id)); } else { println!("stream {} ({}) can't be handled", istr.id, istr.get_info().get_name());