[vlc-commits] demux: ts: fix possibly non monotonic first generated pcr
Francois Cartegnie
git at videolan.org
Thu Nov 12 14:33:42 CET 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 10 16:41:44 2020 +0100| [44782fa1f73fd88787c7b570b7ddabe705c49173] | committer: Francois Cartegnie
demux: ts: fix possibly non monotonic first generated pcr
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=44782fa1f73fd88787c7b570b7ddabe705c49173
---
modules/demux/mpeg/ts.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index eb521ec19b..cfeccd6a34 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -2237,9 +2237,13 @@ static void ProgramSetPCR( demux_t *p_demux, ts_pmt_t *p_pmt, stime_t i_pcr )
if( i_mindts != VLC_TICK_INVALID )
{
- msg_Dbg( p_demux, "Program %d PCR prequeue fixup %"PRId64"->%"PRId64,
- p_pmt->i_number, TO_SCALE(i_mindts), i_pcr );
- i_pcr = TO_SCALE(i_mindts);
+ if( i_pcr > p_pmt->pcr.i_first ) /* don't bork the natural pcr offset */
+ {
+ msg_Dbg( p_demux, "Program %d PCR prequeue fixup %"PRId64"->%"PRId64,
+ p_pmt->i_number, TO_SCALE(i_mindts), i_pcr );
+ i_pcr = TO_SCALE(i_mindts);
+ }
+ else i_pcr = p_pmt->pcr.i_first;
}
}
More information about the vlc-commits
mailing list