vlc | branch: master | Steve Lhomme <rob...@ycbcr.xyz> | Tue Jan 2 16:38:12 2018 +0100| [7663e2adcc8f610bc82e2477e58d2c8150f1fd77] | committer: Jean-Baptiste Kempf
demux:mkv: store the seekable states on startup Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7663e2adcc8f610bc82e2477e58d2c8150f1fd77 --- modules/demux/mkv/demux.hpp | 2 ++ modules/demux/mkv/matroska_segment.cpp | 5 +---- modules/demux/mkv/matroska_segment_parse.cpp | 4 +--- modules/demux/mkv/mkv.cpp | 4 ++++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/demux/mkv/demux.hpp b/modules/demux/mkv/demux.hpp index 1d6c3d5bf5..bdca8cb9e7 100644 --- a/modules/demux/mkv/demux.hpp +++ b/modules/demux/mkv/demux.hpp @@ -351,6 +351,8 @@ public: /* current data */ demux_t & demuxer; + bool b_seekable; + bool b_fastseekable; mtime_t i_pts; mtime_t i_pcr; diff --git a/modules/demux/mkv/matroska_segment.cpp b/modules/demux/mkv/matroska_segment.cpp index bd7cc3202c..681a166936 100644 --- a/modules/demux/mkv/matroska_segment.cpp +++ b/modules/demux/mkv/matroska_segment.cpp @@ -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; diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp index aba61b06d5..0b7967d48b 100644 --- a/modules/demux/mkv/matroska_segment_parse.cpp +++ b/modules/demux/mkv/matroska_segment_parse.cpp @@ -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, diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp index b813e99ece..99967c67aa 100644 --- a/modules/demux/mkv/mkv.cpp +++ b/modules/demux/mkv/mkv.cpp @@ -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 ); _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits