X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-commonfmt%2Fsrc%2Fcodecs%2Fpcm.rs;h=edc8124e473c811b388ae74ecc9344da598523c4;hp=b718b67bfc7bce4230e0a86ad6d07d87889ed982;hb=1a967e6bad5f17943b4de0607078eb940ad5adfe;hpb=3c38de0f394218a267cf15edda331dc4f2ed61bb diff --git a/nihav-commonfmt/src/codecs/pcm.rs b/nihav-commonfmt/src/codecs/pcm.rs index b718b67..edc8124 100644 --- a/nihav-commonfmt/src/codecs/pcm.rs +++ b/nihav-commonfmt/src/codecs/pcm.rs @@ -49,9 +49,7 @@ impl NADecoder for PCMDecoder { if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() { let duration = get_duration(&ainfo, pkt.get_duration(), pkt.get_buffer().len()); let pktbuf = pkt.get_buffer(); - let mut buf: Vec = Vec::with_capacity(pktbuf.len()); - buf.clone_from(&pktbuf); - let abuf = NAAudioBuffer::new_from_buf(ainfo, Rc::new(RefCell::new(buf)), self.chmap.clone()); + let abuf = NAAudioBuffer::new_from_buf(ainfo, pktbuf, self.chmap.clone()); let mut frm = NAFrame::new_from_pkt(pkt, info, NABufferType::AudioPacked(abuf)); frm.set_duration(Some(duration)); frm.set_keyframe(true);