From: Laurent Aimar Date: Thu, 7 May 2009 20:55:13 +0000 (+0200) Subject: Try to workaround serialno change in ogg web radio. X-Git-Tag: 1.0.0-rc1~17 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=816e1cd33078a791c0c2ad901bd1a2366b74f142;p=vlc Try to workaround serialno change in ogg web radio. At each serialno changes, the timestamp being non continuous, there will be an annoying glitch... --- diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c index aa9f687fce..2580c6aba6 100644 --- a/modules/demux/ogg.c +++ b/modules/demux/ogg.c @@ -339,6 +339,18 @@ static int Demux( demux_t * p_demux ) /* if we've just pulled page, look for the right logical stream */ if( !p_sys->b_page_waiting ) { + if( p_sys->i_streams == 1 && + ogg_page_serialno( &oggpage ) != p_stream->os.serialno ) + { + msg_Err( p_demux, "Broken Ogg stream (serialno) mismatch" ); + ogg_stream_reset_serialno( &p_stream->os, ogg_page_serialno( &oggpage ) ); + + p_stream->b_reinit = true; + p_stream->i_pcr = -1; + p_stream->i_interpolated_pcr = -1; + es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); + } + if( ogg_stream_pagein( &p_stream->os, &oggpage ) != 0 ) continue; }