Commit 4c1d4771 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: ogg: don't try seeking using bitrate if incomplete.

Results in wrong position if only one track has bitrate info.
parent 1a5cb04e
......@@ -571,7 +571,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
Ogg_ResetStreamHelper( p_sys );
if ( p_sys->i_bitrate == 0 )
if ( p_sys->i_bitrate == 0 || p_sys->b_partial_bitrate )
{
/* we won't be able to find block by time
* we'll need to bisect search from here
......@@ -1653,7 +1653,12 @@ static int Ogg_BeginningOfStream( demux_t *p_demux )
es_out_Control( p_demux->out, ES_OUT_SET_ES, p_stream->p_es );
}
p_ogg->i_bitrate += p_stream->fmt.i_bitrate;
if ( p_stream->fmt.i_bitrate == 0 &&
( p_stream->fmt.i_cat == VIDEO_ES ||
p_stream->fmt.i_cat == AUDIO_ES ) )
p_ogg->b_partial_bitrate = true;
else
p_ogg->i_bitrate += p_stream->fmt.i_bitrate;
p_stream->i_pcr = p_stream->i_previous_pcr =
p_stream->i_interpolated_pcr = -1;
......
......@@ -102,6 +102,7 @@ struct demux_sys_t
/* bitrate */
int i_bitrate;
bool b_partial_bitrate;
/* after reading all headers, the first data page is stuffed into the relevant stream, ready to use */
bool b_page_waiting;
......
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