[vlc-commits] demux: ogg: don't try seeking using bitrate if incomplete.
Francois Cartegnie
git at videolan.org
Tue Sep 17 11:03:20 CEST 2013
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Sep 17 10:50:38 2013 +0200| [4c1d47718034a807e1aabc72eaf3d21a4a46e6c2] | committer: Francois Cartegnie
demux: ogg: don't try seeking using bitrate if incomplete.
Results in wrong position if only one track has bitrate info.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4c1d47718034a807e1aabc72eaf3d21a4a46e6c2
---
modules/demux/ogg.c | 9 +++++++--
modules/demux/ogg.h | 1 +
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 81fb2de..d6ced62 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -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;
diff --git a/modules/demux/ogg.h b/modules/demux/ogg.h
index cc3e54c..606282c 100644
--- a/modules/demux/ogg.h
+++ b/modules/demux/ogg.h
@@ -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;
More information about the vlc-commits
mailing list