X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-commonfmt%2Fsrc%2Fcodecs%2Fpcm.rs;h=00f5c3158151082b7457a20c5fb0a6b9c67868cc;hb=03accf760cf79bc56d7c6dc6e82cd885fb7e1e13;hp=edc8124e473c811b388ae74ecc9344da598523c4;hpb=1a967e6bad5f17943b4de0607078eb940ad5adfe;p=nihav.git diff --git a/nihav-commonfmt/src/codecs/pcm.rs b/nihav-commonfmt/src/codecs/pcm.rs index edc8124..00f5c31 100644 --- a/nihav-commonfmt/src/codecs/pcm.rs +++ b/nihav-commonfmt/src/codecs/pcm.rs @@ -1,5 +1,3 @@ -use std::rc::Rc; -use std::cell::RefCell; use nihav_core::formats::*; use nihav_core::codecs::*; @@ -35,7 +33,7 @@ fn get_duration(ainfo: &NAAudioInfo, duration: Option, data_size: usize) -> } impl NADecoder for PCMDecoder { - fn init(&mut self, info: Rc) -> DecoderResult<()> { + fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> { if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() { self.chmap = get_default_chmap(ainfo.get_channels()); if self.chmap.num_channels() == 0 { return Err(DecoderError::InvalidData); } @@ -53,7 +51,7 @@ impl NADecoder for PCMDecoder { let mut frm = NAFrame::new_from_pkt(pkt, info, NABufferType::AudioPacked(abuf)); frm.set_duration(Some(duration)); frm.set_keyframe(true); - Ok(Rc::new(RefCell::new(frm))) + Ok(frm.into_ref()) } else { Err(DecoderError::InvalidData) }