[vlc-devel] commit: Do not try to precisely seek (unsing ES_OUT_SET_NEXT_DISPLAY_TIME) if it (Laurent Aimar )

git version control git at videolan.org
Sun Aug 3 13:20:26 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Aug  3 13:19:48 2008 +0200| [2c05ac48ec49a05c80d3b1c1a0f6f2445c4800f9] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c05ac48ec49a05c80d3b1c1a0f6f2445c4800f9
---

 modules/demux/mkv.cpp |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/modules/demux/mkv.cpp b/modules/demux/mkv.cpp
index 04c6f1a..2f6597b 100644
--- a/modules/demux/mkv.cpp
+++ b/modules/demux/mkv.cpp
@@ -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 )




More information about the vlc-devel mailing list