X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-realmedia%2Fsrc%2Fdemuxers%2Frealmedia.rs;h=ad28fcafcbb9149e6d3fee2301edd65ca33f9566;hp=74581d934c93774385b144637e03009753d9e6b7;hb=379524159c95f1c3639976ccf35f9d47cd9732ac;hpb=a480a0de101483d802a11e72d758dae00fa4860a diff --git a/nihav-realmedia/src/demuxers/realmedia.rs b/nihav-realmedia/src/demuxers/realmedia.rs index 74581d9..ad28fca 100644 --- a/nihav-realmedia/src/demuxers/realmedia.rs +++ b/nihav-realmedia/src/demuxers/realmedia.rs @@ -44,7 +44,7 @@ impl RMVideoStream { } } fn flush(&mut self) { - self.frame.truncate(0); + self.frame.clear(); self.frame_size = 0; self.frame_pos = 0; } @@ -1185,8 +1185,8 @@ fn read_string_size(src: &mut ByteReader, size: usize) -> DemuxerResult vec.push(c); } let str = String::from_utf8(vec); - if str.is_ok() { - Ok(str.unwrap()) + if let Ok(res) = str { + Ok(res) } else { Ok(String::new()) } @@ -1653,7 +1653,7 @@ impl<'a> RealIVRDemuxer<'a> { } } -static RM_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ +static RM_VIDEO_CODEC_REGISTER: &[(&[u8;4], &str)] = &[ (b"RV10", "realvideo1"), (b"RV20", "realvideo2"), (b"RVTR", "realvideo2"), @@ -1663,7 +1663,7 @@ static RM_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"CLV1", "clearvideo_rm"), ]; -static RM_AUDIO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ +static RM_AUDIO_CODEC_REGISTER: &[(&[u8;4], &str)] = &[ (b"lpcJ", "ra14.4"), (b"28_8", "ra28.8"), (b"cook", "cook"),