From: Kostya Shishkov Date: Sat, 9 Nov 2019 17:57:34 +0000 (+0100) Subject: add flush() to decoder interface X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=f9be4e750dccff762b9a3d894faec50ffdb59233;p=nihav.git add flush() to decoder interface --- diff --git a/nihav-commonfmt/src/codecs/aac.rs b/nihav-commonfmt/src/codecs/aac.rs index 04fff33..aeb2d06 100644 --- a/nihav-commonfmt/src/codecs/aac.rs +++ b/nihav-commonfmt/src/codecs/aac.rs @@ -1250,6 +1250,12 @@ impl NADecoder for AACDecoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + for pair in self.pairs.iter_mut() { + pair.ics[0].delay = [0.0; 1024]; + pair.ics[1].delay = [0.0; 1024]; + } + } } pub fn get_decoder() -> Box { diff --git a/nihav-commonfmt/src/codecs/atrac3.rs b/nihav-commonfmt/src/codecs/atrac3.rs index c80bd36..441da89 100644 --- a/nihav-commonfmt/src/codecs/atrac3.rs +++ b/nihav-commonfmt/src/codecs/atrac3.rs @@ -687,6 +687,12 @@ impl NADecoder for Atrac3Decoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + for ch_data in self.ch_data.iter_mut() { + ch_data.delay = [0.0; 1024]; + ch_data.qmf_delay = [0.0; 64 * 3]; + } + } } pub fn get_decoder() -> Box { diff --git a/nihav-commonfmt/src/codecs/clearvideo.rs b/nihav-commonfmt/src/codecs/clearvideo.rs index 3e913a9..790ea3e 100644 --- a/nihav-commonfmt/src/codecs/clearvideo.rs +++ b/nihav-commonfmt/src/codecs/clearvideo.rs @@ -698,6 +698,9 @@ impl NADecoder for ClearVideoDecoder { } Ok(frm.into_ref()) } + fn flush(&mut self) { + self.frmmgr.clear(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-commonfmt/src/codecs/pcm.rs b/nihav-commonfmt/src/codecs/pcm.rs index 49e9dad..32c8de0 100644 --- a/nihav-commonfmt/src/codecs/pcm.rs +++ b/nihav-commonfmt/src/codecs/pcm.rs @@ -56,6 +56,8 @@ impl NADecoder for PCMDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-commonfmt/src/codecs/sipro.rs b/nihav-commonfmt/src/codecs/sipro.rs index fd035c6..745feaf 100644 --- a/nihav-commonfmt/src/codecs/sipro.rs +++ b/nihav-commonfmt/src/codecs/sipro.rs @@ -732,6 +732,8 @@ impl NADecoder for SiproDecoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-commonfmt/src/codecs/ts102366.rs b/nihav-commonfmt/src/codecs/ts102366.rs index 65b1b9e..62acaeb 100644 --- a/nihav-commonfmt/src/codecs/ts102366.rs +++ b/nihav-commonfmt/src/codecs/ts102366.rs @@ -1235,6 +1235,9 @@ impl NADecoder for AudioDecoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.delay = [[0.0; BLOCK_LEN]; MAX_CHANNELS + 1]; + } } pub fn get_decoder() -> Box { diff --git a/nihav-core/src/codecs/mod.rs b/nihav-core/src/codecs/mod.rs index ee6f5cd..7ce056d 100644 --- a/nihav-core/src/codecs/mod.rs +++ b/nihav-core/src/codecs/mod.rs @@ -255,6 +255,7 @@ impl Default for NADecoderSupport { pub trait NADecoder { fn init(&mut self, supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()>; fn decode(&mut self, supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult; + fn flush(&mut self); } #[derive(Clone,Copy)] diff --git a/nihav-duck/src/codecs/dkadpcm.rs b/nihav-duck/src/codecs/dkadpcm.rs index d339556..24f5b5b 100644 --- a/nihav-duck/src/codecs/dkadpcm.rs +++ b/nihav-duck/src/codecs/dkadpcm.rs @@ -163,6 +163,8 @@ impl NADecoder for DuckADPCMDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + } } pub fn get_decoder_dk3() -> Box { diff --git a/nihav-duck/src/codecs/on2avc.rs b/nihav-duck/src/codecs/on2avc.rs index 46880fa..8273437 100644 --- a/nihav-duck/src/codecs/on2avc.rs +++ b/nihav-duck/src/codecs/on2avc.rs @@ -1044,6 +1044,8 @@ impl NADecoder for AVCDecoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder_500() -> Box { diff --git a/nihav-duck/src/codecs/truemotion1.rs b/nihav-duck/src/codecs/truemotion1.rs index 44ff668..c313b13 100644 --- a/nihav-duck/src/codecs/truemotion1.rs +++ b/nihav-duck/src/codecs/truemotion1.rs @@ -654,6 +654,9 @@ impl NADecoder for TM1Decoder { frm.set_frame_type(if is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.lastframe.reset(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-duck/src/codecs/truemotion2.rs b/nihav-duck/src/codecs/truemotion2.rs index ecfce30..c222c44 100644 --- a/nihav-duck/src/codecs/truemotion2.rs +++ b/nihav-duck/src/codecs/truemotion2.rs @@ -577,6 +577,8 @@ impl NADecoder for TM2Decoder { frm.set_frame_type(if is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-duck/src/codecs/truemotion2x.rs b/nihav-duck/src/codecs/truemotion2x.rs index 16d1125..584ee43 100644 --- a/nihav-duck/src/codecs/truemotion2x.rs +++ b/nihav-duck/src/codecs/truemotion2x.rs @@ -688,6 +688,8 @@ impl NADecoder for TM2XDecoder { frm.set_frame_type(if self.is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-duck/src/codecs/truemotionrt.rs b/nihav-duck/src/codecs/truemotionrt.rs index ba2ff17..97ad981 100644 --- a/nihav-duck/src/codecs/truemotionrt.rs +++ b/nihav-duck/src/codecs/truemotionrt.rs @@ -80,6 +80,8 @@ impl NADecoder for TMRTDecoder { frm.set_frame_type(FrameType::I); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-duck/src/codecs/vp3.rs b/nihav-duck/src/codecs/vp3.rs index d25d27f..dd71c8b 100644 --- a/nihav-duck/src/codecs/vp3.rs +++ b/nihav-duck/src/codecs/vp3.rs @@ -1839,6 +1839,9 @@ impl NADecoder for VP34Decoder { frm.set_frame_type(if self.is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.shuf.clear(); + } } pub fn get_decoder_vp3() -> Box { diff --git a/nihav-duck/src/codecs/vp5.rs b/nihav-duck/src/codecs/vp5.rs index abfd4d0..d13ffab 100644 --- a/nihav-duck/src/codecs/vp5.rs +++ b/nihav-duck/src/codecs/vp5.rs @@ -267,6 +267,9 @@ impl NADecoder for VP5Decoder { frm.set_frame_type(ftype); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-duck/src/codecs/vp56.rs b/nihav-duck/src/codecs/vp56.rs index d0a991f..28b1f06 100644 --- a/nihav-duck/src/codecs/vp56.rs +++ b/nihav-duck/src/codecs/vp56.rs @@ -428,6 +428,9 @@ impl VP56Decoder { self.set_dimensions(vinfo.get_width(), vinfo.get_height()); Ok(()) } + pub fn flush(&mut self) { + self.shuf.clear(); + } pub fn decode_frame(&mut self, supp: &mut NADecoderSupport, src: &[u8], br: &mut dyn VP56Parser) -> DecoderResult<(NABufferType, FrameType)> { let aoffset; let mut bc; diff --git a/nihav-duck/src/codecs/vp6.rs b/nihav-duck/src/codecs/vp6.rs index 1cf6a78..803ce5e 100644 --- a/nihav-duck/src/codecs/vp6.rs +++ b/nihav-duck/src/codecs/vp6.rs @@ -701,6 +701,9 @@ impl NADecoder for VP6Decoder { frm.set_frame_type(ftype); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } pub fn get_decoder_vp6() -> Box { diff --git a/nihav-duck/src/codecs/vp7.rs b/nihav-duck/src/codecs/vp7.rs index ccdb5dd..b96da83 100644 --- a/nihav-duck/src/codecs/vp7.rs +++ b/nihav-duck/src/codecs/vp7.rs @@ -1392,6 +1392,9 @@ impl NADecoder for VP7Decoder { frm.set_frame_type(if self.dstate.is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.shuf.clear(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-game/src/codecs/bmv.rs b/nihav-game/src/codecs/bmv.rs index f2458af..902ae51 100644 --- a/nihav-game/src/codecs/bmv.rs +++ b/nihav-game/src/codecs/bmv.rs @@ -216,6 +216,8 @@ impl NADecoder for BMVVideoDecoder { frm.set_frame_type(if is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } @@ -293,6 +295,8 @@ impl NADecoder for BMVAudioDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + } } pub fn get_decoder_audio() -> Box { diff --git a/nihav-game/src/codecs/bmv3.rs b/nihav-game/src/codecs/bmv3.rs index efc3c7e..47378af 100644 --- a/nihav-game/src/codecs/bmv3.rs +++ b/nihav-game/src/codecs/bmv3.rs @@ -499,6 +499,8 @@ impl NADecoder for BMV3VideoDecoder { frm.set_frame_type(if self.is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } @@ -589,6 +591,8 @@ impl NADecoder for BMV3AudioDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + } } pub fn get_decoder_audio() -> Box { diff --git a/nihav-game/src/codecs/gremlinvideo.rs b/nihav-game/src/codecs/gremlinvideo.rs index 621e23c..67be656 100644 --- a/nihav-game/src/codecs/gremlinvideo.rs +++ b/nihav-game/src/codecs/gremlinvideo.rs @@ -456,6 +456,8 @@ impl NADecoder for GremlinVideoDecoder { frm.set_frame_type(if is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder_video() -> Box { @@ -548,6 +550,8 @@ impl NADecoder for GremlinAudioDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + } } pub fn get_decoder_audio() -> Box { diff --git a/nihav-game/src/codecs/midivid.rs b/nihav-game/src/codecs/midivid.rs index 299e5ac..037248f 100644 --- a/nihav-game/src/codecs/midivid.rs +++ b/nihav-game/src/codecs/midivid.rs @@ -169,6 +169,9 @@ impl NADecoder for MidividDecoder { frm.set_frame_type(if is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.hams.clear(); + } } diff --git a/nihav-game/src/codecs/vmd.rs b/nihav-game/src/codecs/vmd.rs index 4284716..e7f724f 100644 --- a/nihav-game/src/codecs/vmd.rs +++ b/nihav-game/src/codecs/vmd.rs @@ -264,6 +264,9 @@ impl NADecoder for VMDVideoDecoder { frm.set_frame_type(if is_intra { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.hams.clear(); + } } @@ -436,6 +439,8 @@ impl NADecoder for VMDAudioDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + } } pub fn get_decoder_audio() -> Box { diff --git a/nihav-indeo/src/codecs/imc.rs b/nihav-indeo/src/codecs/imc.rs index c895522..4b7c990 100644 --- a/nihav-indeo/src/codecs/imc.rs +++ b/nihav-indeo/src/codecs/imc.rs @@ -922,6 +922,8 @@ impl NADecoder for IMCDecoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder_imc() -> Box { diff --git a/nihav-indeo/src/codecs/indeo2.rs b/nihav-indeo/src/codecs/indeo2.rs index a022ec4..56ec122 100644 --- a/nihav-indeo/src/codecs/indeo2.rs +++ b/nihav-indeo/src/codecs/indeo2.rs @@ -357,6 +357,9 @@ impl NADecoder for Indeo2Decoder { Ok(frm.into_ref()) } } + fn flush(&mut self) { + self.frmmgr.clear(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-indeo/src/codecs/indeo3.rs b/nihav-indeo/src/codecs/indeo3.rs index 9687f94..6e03cb3 100644 --- a/nihav-indeo/src/codecs/indeo3.rs +++ b/nihav-indeo/src/codecs/indeo3.rs @@ -783,6 +783,9 @@ impl NADecoder for Indeo3Decoder { frm.set_frame_type(if intraframe { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.bufs.reset(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-indeo/src/codecs/indeo4.rs b/nihav-indeo/src/codecs/indeo4.rs index 15cae6d..03918be 100644 --- a/nihav-indeo/src/codecs/indeo4.rs +++ b/nihav-indeo/src/codecs/indeo4.rs @@ -455,6 +455,9 @@ impl NADecoder for Indeo4Decoder { frm.set_frame_type(self.dec.get_frame_type()); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } const INDEO4_PICTURE_SIZE_TAB: [[usize; 2]; 7] = [ diff --git a/nihav-indeo/src/codecs/indeo5.rs b/nihav-indeo/src/codecs/indeo5.rs index eec603a..8111164 100644 --- a/nihav-indeo/src/codecs/indeo5.rs +++ b/nihav-indeo/src/codecs/indeo5.rs @@ -530,6 +530,9 @@ impl NADecoder for Indeo5Decoder { frm.set_frame_type(self.dec.get_frame_type()); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } const INDEO5_PICTURE_SIZE_TAB: [[usize; 2]; 15] = [ diff --git a/nihav-indeo/src/codecs/intel263.rs b/nihav-indeo/src/codecs/intel263.rs index fb23bfc..d7302ce 100644 --- a/nihav-indeo/src/codecs/intel263.rs +++ b/nihav-indeo/src/codecs/intel263.rs @@ -404,6 +404,9 @@ impl NADecoder for Intel263Decoder { frm.set_frame_type(if self.dec.is_intra() { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } diff --git a/nihav-indeo/src/codecs/ivibr.rs b/nihav-indeo/src/codecs/ivibr.rs index 029b815..cfb073f 100644 --- a/nihav-indeo/src/codecs/ivibr.rs +++ b/nihav-indeo/src/codecs/ivibr.rs @@ -945,6 +945,14 @@ br.skip(skip_part as u32)?; res } + pub fn flush(&mut self) { + self.prev_frame = MISSING_REF; + self.next_frame = MISSING_REF; + self.iref_0 = MISSING_REF; + self.iref_1 = MISSING_REF; + self.scal_ref = MISSING_REF; + } + pub fn is_intra(&self) -> bool { self.ftype.is_intra() } diff --git a/nihav-rad/src/codecs/bink2.rs b/nihav-rad/src/codecs/bink2.rs index 8c09478..e56bff7 100644 --- a/nihav-rad/src/codecs/bink2.rs +++ b/nihav-rad/src/codecs/bink2.rs @@ -1937,6 +1937,9 @@ impl NADecoder for Bink2Decoder { frm.set_frame_type(if self.key_frame { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.ips.clear(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-rad/src/codecs/binkaud.rs b/nihav-rad/src/codecs/binkaud.rs index b0c4fc2..86f4fb0 100644 --- a/nihav-rad/src/codecs/binkaud.rs +++ b/nihav-rad/src/codecs/binkaud.rs @@ -273,6 +273,9 @@ impl NADecoder for BinkAudioDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + self.delay = [[0.0; 256]; 2]; + } } pub fn get_decoder_dct() -> Box { diff --git a/nihav-rad/src/codecs/binkvid.rs b/nihav-rad/src/codecs/binkvid.rs index 69e30fe..6d6c14a 100644 --- a/nihav-rad/src/codecs/binkvid.rs +++ b/nihav-rad/src/codecs/binkvid.rs @@ -1258,6 +1258,9 @@ println!("decode frame {} b={} i={}", pkt.get_pts().unwrap(), self.is_ver_b, sel frm.set_frame_type(FrameType::P); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.ips.clear(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-rad/src/codecs/smacker.rs b/nihav-rad/src/codecs/smacker.rs index 99d40d6..cb7d0ba 100644 --- a/nihav-rad/src/codecs/smacker.rs +++ b/nihav-rad/src/codecs/smacker.rs @@ -465,6 +465,8 @@ impl NADecoder for SmackerVideoDecoder { frm.set_frame_type(ftype); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder_video() -> Box { @@ -589,6 +591,8 @@ impl NADecoder for SmackerAudioDecoder { Err(DecoderError::InvalidData) } } + fn flush(&mut self) { + } } pub fn get_decoder_audio() -> Box { diff --git a/nihav-realmedia/src/codecs/cook.rs b/nihav-realmedia/src/codecs/cook.rs index 62a2811..a1a32e4 100644 --- a/nihav-realmedia/src/codecs/cook.rs +++ b/nihav-realmedia/src/codecs/cook.rs @@ -669,6 +669,11 @@ impl NADecoder for CookDecoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + for pair in self.pairs.iter_mut() { + pair.delay = [[0.0; MAX_SAMPLES]; 2]; + } + } } pub fn get_decoder() -> Box { diff --git a/nihav-realmedia/src/codecs/ra144.rs b/nihav-realmedia/src/codecs/ra144.rs index 87edae9..4e8a6a5 100644 --- a/nihav-realmedia/src/codecs/ra144.rs +++ b/nihav-realmedia/src/codecs/ra144.rs @@ -307,6 +307,8 @@ impl NADecoder for RA144Decoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-realmedia/src/codecs/ra288.rs b/nihav-realmedia/src/codecs/ra288.rs index 9a30ab4..ef8faae 100644 --- a/nihav-realmedia/src/codecs/ra288.rs +++ b/nihav-realmedia/src/codecs/ra288.rs @@ -197,6 +197,8 @@ impl NADecoder for RA288Decoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-realmedia/src/codecs/ralf.rs b/nihav-realmedia/src/codecs/ralf.rs index c472862..7bcab6b 100644 --- a/nihav-realmedia/src/codecs/ralf.rs +++ b/nihav-realmedia/src/codecs/ralf.rs @@ -467,6 +467,8 @@ impl NADecoder for RALFDecoder { frm.set_keyframe(true); Ok(frm.into_ref()) } + fn flush(&mut self) { + } } pub fn get_decoder() -> Box { diff --git a/nihav-realmedia/src/codecs/rv10.rs b/nihav-realmedia/src/codecs/rv10.rs index d6d4dc6..9184b57 100644 --- a/nihav-realmedia/src/codecs/rv10.rs +++ b/nihav-realmedia/src/codecs/rv10.rs @@ -449,6 +449,9 @@ println!("???"); frm.set_frame_type(if self.dec.is_intra() { FrameType::I } else { FrameType::P }); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } diff --git a/nihav-realmedia/src/codecs/rv20.rs b/nihav-realmedia/src/codecs/rv20.rs index 81556d8..b312a12 100644 --- a/nihav-realmedia/src/codecs/rv20.rs +++ b/nihav-realmedia/src/codecs/rv20.rs @@ -503,6 +503,9 @@ impl NADecoder for RealVideo20Decoder { frm.set_frame_type(self.dec.get_frame_type()); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } struct MBB { blocks: usize, bits: u8 } diff --git a/nihav-realmedia/src/codecs/rv30.rs b/nihav-realmedia/src/codecs/rv30.rs index d423176..8c11413 100644 --- a/nihav-realmedia/src/codecs/rv30.rs +++ b/nihav-realmedia/src/codecs/rv30.rs @@ -159,6 +159,9 @@ println!("???"); frm.set_frame_type(ftype);//if ftype == FrameType::B { FrameType::Skip } else { ftype } ); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-realmedia/src/codecs/rv3040.rs b/nihav-realmedia/src/codecs/rv3040.rs index dde0b04..640de41 100644 --- a/nihav-realmedia/src/codecs/rv3040.rs +++ b/nihav-realmedia/src/codecs/rv3040.rs @@ -1250,4 +1250,7 @@ impl RV34Decoder { Ok((NABufferType::Video(buf), hdr0.ftype, ts)) } + pub fn flush(&mut self) { + self.ipbs.clear(); + } } diff --git a/nihav-realmedia/src/codecs/rv40.rs b/nihav-realmedia/src/codecs/rv40.rs index 7586aae..bd1f75b 100644 --- a/nihav-realmedia/src/codecs/rv40.rs +++ b/nihav-realmedia/src/codecs/rv40.rs @@ -352,6 +352,9 @@ println!("???"); frm.set_pts(Some(ts)); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.dec.flush(); + } } pub fn get_decoder() -> Box { diff --git a/nihav-realmedia/src/codecs/rv60.rs b/nihav-realmedia/src/codecs/rv60.rs index a4cf919..bf89a51 100644 --- a/nihav-realmedia/src/codecs/rv60.rs +++ b/nihav-realmedia/src/codecs/rv60.rs @@ -1475,6 +1475,9 @@ println!("???"); frm.set_frame_type(hdr.ftype); Ok(frm.into_ref()) } + fn flush(&mut self) { + self.ipbs.clear(); + } } pub fn get_decoder() -> Box {