}
impl<'a> DemuxerObject<'a> {
- pub fn create(mut brb: ReaderBox<'a>, reg: &FullRegister, name: &str, ifmt: &Option<String>, is_raw: bool) -> DemuxerObject<'a> {
+ pub fn create(mut brb: ReaderBox<'a>, reg: &FullRegister, name: &str, ifmt: &Option<String>, is_raw: bool, print_info: bool) -> DemuxerObject<'a> {
let br = brb.get_object_mut();
if !is_raw {
let dmx_name = if let Some(ref dname) = ifmt {
dname.as_str()
} else if let Some((dname, score)) = detect::detect_format(name, br) {
- println!("detected {} with score {:?}", dname, score);
+ if print_info {
+ println!("detected {} with score {:?}", dname, score);
+ }
dname
} else {
""
};
if !dmx_name.is_empty() {
- println!("trying demuxer {} on {}", dmx_name, name);
+ if print_info {
+ println!("trying demuxer {} on {}", dmx_name, name);
+ }
if let Some(dmx_fact) = reg.dmx_reg.find_demuxer(dmx_name) {
br.seek(SeekFrom::Start(0)).unwrap();
return DemuxerObject::None;
}
if !dmx_name.is_empty() {
- println!("trying raw demuxer {} on {}", dmx_name, name);
+ if print_info {
+ println!("trying raw demuxer {} on {}", dmx_name, name);
+ }
if let Some(rdmx_fact) = reg.rdmx_reg.find_demuxer(dmx_name) {
br.seek(SeekFrom::Start(0)).unwrap();
let dmx = SelfBorrow::new(brb, |br_| {
}
for rdmx in reg.rdmx_reg.iter() {
if rdmx.check_format(br) {
- println!("detected {} as {}", name, rdmx.get_name());
+ if print_info {
+ println!("detected {} as {}", name, rdmx.get_name());
+ }
br.seek(SeekFrom::Start(0)).unwrap();
let dmx = SelfBorrow::new(brb, |br_| {
unsafe {
}
}
if !pname.is_empty() {
- println!("found raw stream of type {} for {}", pname, name);
+ if print_info {
+ println!("found raw stream of type {} for {}", pname, name);
+ }
let pcreate = reg.pkt_reg.find_packetiser(pname).unwrap();
let rctx = SelfBorrow::new(brb, |br_| {
unsafe {