[vlc-commits] demux: ps: only apply previous fix to audio/video

Francois Cartegnie git at videolan.org
Mon Mar 6 16:20:31 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar  6 16:13:07 2017 +0100| [088aeb60fb7620b509b1ecd24e1f99ee7d4e725c] | committer: Francois Cartegnie

demux: ps: only apply previous fix to audio/video

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

 modules/demux/mpeg/ps.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mpeg/ps.c b/modules/demux/mpeg/ps.c
index 914a3fd..c0ad2c3 100644
--- a/modules/demux/mpeg/ps.c
+++ b/modules/demux/mpeg/ps.c
@@ -416,8 +416,13 @@ static int Demux( demux_t *p_demux )
 
             if( p_sys->i_scr >= 0 && !p_sys->b_bad_scr )
             {
-                if( tk->i_first_pts > VLC_TS_INVALID && tk->i_first_pts - p_sys->i_scr > CLOCK_FREQ )
+                if( (tk->fmt.i_cat == AUDIO_ES || tk->fmt.i_cat == VIDEO_ES) &&
+                    tk->i_first_pts > VLC_TS_INVALID && tk->i_first_pts - p_sys->i_scr > CLOCK_FREQ )
+                {
+                    msg_Warn( p_demux, "Incorrect SCR timing offset by of %ld ms, disabling",
+                                       tk->i_first_pts - p_sys->i_scr / 1000 );
                     p_sys->b_bad_scr = true; /* Disable Offset SCR */
+                }
                 else
                     es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_scr );
             }



More information about the vlc-commits mailing list