NumberMode::PktPTS => { pkt.get_pts().unwrap() },
NumberMode::FrmPTS => { if let Some(pt) = frm.get_pts() { pt } else { pkt.get_pts().unwrap() } },
};
- if let Err(_) = write_pnm(&self.prefix, self.streamno, pts, frm) {
+ if write_pnm(&self.prefix, self.streamno, pts, frm).is_err() {
println!("error writing output picture");
}
}
if dump_frames {
let name = format!("out{:02}_{:08}.frm", streamno, pkt.get_pts().unwrap_or(frmnum));
let mut ofile = File::create(name).unwrap();
- ofile.write(pkt.get_buffer().as_slice()).unwrap();
+ ofile.write_all(pkt.get_buffer().as_slice()).unwrap();
frmnum += 1;
}
if let Some((ref mut dsupp, ref mut dec)) = decs[idx] {