[vlc-commits] ts: fix applying pcr offset in PCRCheckDTS()

Petri Hintukainen git at videolan.org
Sun Feb 28 19:56:48 CET 2016


vlc | branch: master | Petri Hintukainen <phintuka at gmail.com> | Sat Feb 27 22:50:46 2016 +0200| [440eec356fbd2271d3a93e4fe1bffe48a1999cfd] | committer: Jean-Baptiste Kempf

ts: fix applying pcr offset in PCRCheckDTS()

Improve logging

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=440eec356fbd2271d3a93e4fe1bffe48a1999cfd
---

 modules/demux/mpeg/ts.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index bd7a5b2..6295093 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -2120,16 +2120,23 @@ static void PCRCheckDTS( demux_t *p_demux, ts_pmt_t *p_pmt, mtime_t i_pcr)
             continue;
 
         if (p_pmt->pcr.i_pcroffset > 0) {
-            i_dts += p_pmt->pcr.i_pcroffset;
-            i_pts += p_pmt->pcr.i_pcroffset;
+            if( i_dts > 0 ) {
+                i_dts += p_pmt->pcr.i_pcroffset;
+            }
+            if( i_pts > 0 ) {
+                i_pts += p_pmt->pcr.i_pcroffset;
+            }
         }
 
         i_dts = TimeStampWrapAround( i_pcr, i_dts );
         i_pts = TimeStampWrapAround( i_pcr, i_pts );
 
-        if ((i_dts > 0 && i_dts <= i_pcr) || (i_pts > 0 && i_pts <= i_pcr)) {
+        if( i_dts > 0 && i_dts <= i_pcr ) {
             msg_Err( p_demux, "send queued data for pid %d: DTS %"PRId64" >= PCR %"PRId64"\n", p_pid->i_pid, i_dts, i_pcr);
             ParsePESDataChain( p_demux, p_pid );
+        } else if( i_pts > 0 && i_pts <= i_pcr ) {
+            msg_Err( p_demux, "send queued data for pid %d: PTS %"PRId64" >= PCR %"PRId64"\n", p_pid->i_pid, i_pts, i_pcr);
+            ParsePESDataChain( p_demux, p_pid );
         }
     }
 }



More information about the vlc-commits mailing list