Commit 2c05ac48 authored by Laurent Aimar's avatar Laurent Aimar

Do not try to precisely seek (unsing ES_OUT_SET_NEXT_DISPLAY_TIME) if it

is too far away (> 500ms) from a key frame.
It will reduce seek precision but the implementation of
ES_OUT_SET_NEXT_DISPLAY_TIME is not good enough yet.
parent 1348f88f
......@@ -5873,7 +5873,7 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset )
if( i_track < tracks.size() )
{
if( sys.i_pts >= sys.i_start_pts )
if( sys.i_pts >= sys.i_start_pts )
{
cluster = static_cast<KaxCluster*>(ep->UnGet( i_block_pos, i_cluster_pos ));
i_track_skipping = 0;
......@@ -5887,6 +5887,8 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset )
}
if( !tracks[i_track]->b_search_keyframe )
{
//es_out_Control( sys.demuxer.out, ES_OUT_SET_PCR, sys.i_pts );
#if LIBMATROSKA_VERSION >= 0x000800
BlockDecode( &sys.demuxer, block, simpleblock, sys.i_pts, 0, i_block_ref1 >= 0 || i_block_ref2 > 0 );
#else
......@@ -5898,6 +5900,16 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset )
delete block;
}
/* FIXME current ES_OUT_SET_NEXT_DISPLAY_TIME does not work that well if
* the delay is too high. */
if( sys.i_pts + 500*1000 < sys.i_start_pts )
{
sys.i_start_pts = sys.i_pts;
for( i_track = 0; i_track < tracks.size(); i_track++ )
es_out_Control( sys.demuxer.out, ES_OUT_SET_NEXT_DISPLAY_TIME, tracks[i_track]->p_es, sys.i_start_pts );
}
}
void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_date, mtime_t i_time_offset, chapter_item_c *psz_chapter )
......
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