[vlc-commits] access: live555: define and set pcr offset

Francois Cartegnie git at videolan.org
Tue Nov 14 14:49:04 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 14 14:45:00 2017 +0100| [3fa85e6a2b45e1f05252f8ce109ff92b07f041f2] | committer: Francois Cartegnie

access: live555: define and set pcr offset

tries to have a pcr delay between 250ms and 500ms

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

 modules/access/live555.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/modules/access/live555.cpp b/modules/access/live555.cpp
index 0fd82e91c8..6cd6edf285 100644
--- a/modules/access/live555.cpp
+++ b/modules/access/live555.cpp
@@ -274,6 +274,9 @@ static unsigned char* parseVorbisConfigStr( char const* configStr,
 
 static char *passwordLessURL( vlc_url_t *url );
 
+#define PCR_OBS (CLOCK_FREQ / 4)
+#define PCR_OFF PCR_OBS
+
 /*****************************************************************************
  * DemuxOpen:
  *****************************************************************************/
@@ -1379,12 +1382,13 @@ static int Demux( demux_t *p_demux )
                 tk->i_next_block_flags |= BLOCK_FLAG_DISCONTINUITY;
             }
             if( p_sys->i_pcr != VLC_TS_INVALID )
-                es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
+                es_out_SetPCR( p_demux->out, VLC_TS_0 +
+                               __MAX(0, p_sys->i_pcr - PCR_OFF) );
         }
         else if( p_sys->i_pcr == VLC_TS_INVALID ||
-                 i_minpcr > p_sys->i_pcr + CLOCK_FREQ / 4 )
+                 i_minpcr > p_sys->i_pcr + PCR_OBS )
         {
-            p_sys->i_pcr = i_minpcr;
+            p_sys->i_pcr = __MAX(0, i_minpcr - PCR_OFF);
             if( p_sys->i_pcr != VLC_TS_INVALID )
                 es_out_SetPCR( p_demux->out, VLC_TS_0 + p_sys->i_pcr );
         }



More information about the vlc-commits mailing list