From: Kostya Shishkov Date: Thu, 6 Sep 2018 09:44:47 +0000 (+0200) Subject: rmdec: handle situation when last partial frame is full frame X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=5b744f82bb80a19d86211aac8dfdda060cc93f4b;p=nihav.git rmdec: handle situation when last partial frame is full frame --- diff --git a/src/demuxers/realmedia.rs b/src/demuxers/realmedia.rs index 4415192..2702b9b 100644 --- a/src/demuxers/realmedia.rs +++ b/src/demuxers/realmedia.rs @@ -375,7 +375,11 @@ impl<'a> DemuxCore<'a> for RealMediaDemuxer<'a> { //println!(" mode 2 pkt {}/{} tail {}/{} seq {}", packet_num, num_pkts, tail_size, frame_size, seq_no); self.slice_buf.resize(tail_size as usize, 0); self.src.read_buf(self.slice_buf.as_mut_slice())?; - vstr.add_slice(packet_num as usize, self.slice_buf.as_slice()); + if packet_num == 1 && frame_size == tail_size { + vstr.start_slice(num_pkts, frame_size as usize, self.slice_buf.as_slice()); + } else { + vstr.add_slice(packet_num as usize, self.slice_buf.as_slice()); + } while self.src.tell() < pos + (payload_size as u64) { let res = read_multiple_frame(self.src, stream.clone(), false, false);