From: Kostya Shishkov Date: Wed, 1 Mar 2023 17:22:54 +0000 (+0100) Subject: realmedia: clear non-existing timestamps in .ra X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=951a626bb478d30a69e3b7ac7f76edfbb5db44aa;p=nihav.git realmedia: clear non-existing timestamps in .ra --- diff --git a/nihav-realmedia/src/demuxers/realmedia.rs b/nihav-realmedia/src/demuxers/realmedia.rs index 14183c9..b2ea958 100644 --- a/nihav-realmedia/src/demuxers/realmedia.rs +++ b/nihav-realmedia/src/demuxers/realmedia.rs @@ -1247,7 +1247,8 @@ impl<'a> DemuxCore<'a> for RealAudioDemuxer<'a> { fn get_frame(&mut self, strmgr: &mut StreamManager) -> DemuxerResult { if !self.queued_pkts.is_empty() { - let pkt = self.queued_pkts.pop().unwrap(); + let mut pkt = self.queued_pkts.pop().unwrap(); + pkt.ts.pts = None; return Ok(pkt); } if (self.data_end != 0) && (self.src.tell() >= self.data_end) { @@ -1257,10 +1258,13 @@ impl<'a> DemuxCore<'a> for RealAudioDemuxer<'a> { let stream = streamres.unwrap(); if let Some(ref mut astr) = self.stream { loop { - let ret = astr.read_apackets(&mut self.queued_pkts, self.src, stream.clone(), 0, false, self.blk_size); + let mut ret = astr.read_apackets(&mut self.queued_pkts, self.src, stream.clone(), 0, false, self.blk_size); if let Err(DemuxerError::TryAgain) = ret { continue; } + if let Ok(ref mut pkt) = ret { + pkt.ts.pts = None; + } return ret; } }