From 38702aacff8127197583ebf940a798b97193709e Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Thu, 10 Nov 2005 19:23:12 +0000 Subject: [PATCH 1/1] * modules/demux/ps.c: backport of 13156. --- modules/demux/ps.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/demux/ps.c b/modules/demux/ps.c index 22587db2d3..da61b1284d 100644 --- a/modules/demux/ps.c +++ b/modules/demux/ps.c @@ -68,6 +68,8 @@ struct demux_sys_t int64_t i_scr; int i_mux_rate; + + vlc_bool_t b_lost_sync; }; static int Demux ( demux_t *p_demux ); @@ -107,6 +109,7 @@ static int Open( vlc_object_t *p_this ) /* Init p_sys */ p_sys->i_mux_rate = 0; p_sys->i_scr = -1; + p_sys->b_lost_sync = VLC_FALSE; ps_psm_init( &p_sys->psm ); ps_track_init( p_sys->tk ); @@ -177,10 +180,16 @@ static int Demux( demux_t *p_demux ) } else if( i_ret == 0 ) { - msg_Warn( p_demux, "garbage at input" ); + if( !p_sys->b_lost_sync ) + msg_Warn( p_demux, "garbage at input, trying to resync..." ); + + p_sys->b_lost_sync = VLC_TRUE; return 1; } + if( p_sys->b_lost_sync ) msg_Warn( p_demux, "found sync code" ); + p_sys->b_lost_sync = VLC_FALSE; + if( ( p_pkt = ps_pkt_read( p_demux->s, i_code ) ) == NULL ) { return 0; -- 2.39.2