Commit 7663e2ad authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf
Browse files

demux:mkv: store the seekable states on startup


Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent e37f42f4
......@@ -351,6 +351,8 @@ public:
/* current data */
demux_t & demuxer;
bool b_seekable;
bool b_fastseekable;
mtime_t i_pts;
mtime_t i_pcr;
......
......@@ -1002,10 +1002,7 @@ void matroska_segment_c::EnsureDuration()
i_duration = -1;
bool b_seekable;
if( vlc_stream_Control( sys.demuxer.s, STREAM_CAN_FASTSEEK, &b_seekable ) ||
!b_seekable )
if( !sys.b_fastseekable )
{
msg_Warn( &sys.demuxer, "could not look for the segment duration" );
return;
......
......@@ -86,12 +86,10 @@ static inline char * ToUTF8( const UTFstring &u )
void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
{
EbmlElement *l;
bool b_seekable;
i_seekhead_count++;
vlc_stream_Control( sys.demuxer.s, STREAM_CAN_SEEK, &b_seekable );
if( !b_seekable )
if( !sys.b_seekable )
return;
EbmlParser eparser ( &es, seekhead, &sys.demuxer,
......
......@@ -112,6 +112,10 @@ static int Open( vlc_object_t * p_this )
p_demux->pf_control = Control;
p_demux->p_sys = p_sys = new demux_sys_t( *p_demux );
vlc_stream_Control( p_demux->s, STREAM_CAN_SEEK, &p_sys->b_seekable );
if ( vlc_stream_Control( p_demux->s, STREAM_CAN_FASTSEEK, &p_sys->b_fastseekable ) )
p_sys->b_fastseekable = false;
p_io_callback = new vlc_stream_io_callback( p_demux->s, false );
p_io_stream = new (std::nothrow) EbmlStream( *p_io_callback );
......
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