introduce NADecoderSupport and buffer pools
[nihav.git] / nihav-commonfmt / src / codecs / sipro.rs
index 05e6816588df5047d708a0a20ad06e0c2067caf0..c36c7ed17297bcbc65cf126ddb540df27662399d 100644 (file)
@@ -638,7 +638,7 @@ fn synth_filter(dst: &mut [f32], doff: usize, filt: &[f32], src: &[f32], len: us
 const CHMAP_MONO: [NAChannelType; 1] = [NAChannelType::C];
 
 impl NADecoder for SiproDecoder {
-    fn init(&mut self, info: NACodecInfoRef) -> DecoderResult<()> {
+    fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Audio(ainfo) = info.get_properties() {
             let mut found = false;
             for i in 0..SIPRO_MODES.len() {
@@ -668,7 +668,7 @@ impl NADecoder for SiproDecoder {
             Err(DecoderError::InvalidData)
         }
     }
-    fn decode(&mut self, pkt: &NAPacket) -> DecoderResult<NAFrameRef> {
+    fn decode(&mut self, _supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult<NAFrameRef> {
         let info = pkt.get_stream().get_info();
         validate!(info.get_properties().is_audio());
         let pktbuf = pkt.get_buffer();
@@ -729,7 +729,7 @@ impl NADecoder for SiproDecoder {
 
         let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), abuf);
         frm.set_keyframe(true);
-        Ok(Rc::new(RefCell::new(frm)))
+        Ok(frm.into_ref())
     }
 }