]> git.nihav.org Git - nihav.git/commitdiff
rmdec: handle situation when last partial frame is full frame
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 6 Sep 2018 09:44:47 +0000 (11:44 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 6 Sep 2018 09:44:47 +0000 (11:44 +0200)
src/demuxers/realmedia.rs

index 44151923f3a677f3d0998dedbfea3cca430eecd2..2702b9b1203e94e040f2f43da3c3bc323d89e450 100644 (file)
@@ -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);