fn encode_frame(dst_id: u32, encoder: &mut Box<dyn NAEncoder>, cvt: &mut OutputConvert, frm: NAFrameRef, scale_opts: &[(String, String)]) -> bool {
let buf = frm.get_buffer();
- let cbuf = match cvt {
+ let cbuf = if let NABufferType::None = buf {
+ buf
+ } else {
+ match cvt {
OutputConvert::None => buf,
OutputConvert::Video(ref mut scaler, ref mut dbuf) => {
let cur_ifmt = get_scale_fmt_from_pic(&buf);
}
ret.unwrap()
},
- };
+ }
+ };
let cfrm = NAFrame::new(frm.get_time_information(), frm.frame_type, frm.key, frm.get_info(), cbuf);
encoder.encode(&cfrm).unwrap();
true