Commit 55e26be2 authored by Gildas Bazin's avatar Gildas Bazin

* modules/demux/ps.c: don't flood everything with "garbage at input" messages if we lost sync.

parent 6ab6c771
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment