]> git.sesse.net Git - vlc/commitdiff
Handle MKV segment change properly
authorDenis Charmet <typx@dinauz.org>
Thu, 2 Feb 2012 00:42:54 +0000 (01:42 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 2 Feb 2012 14:04:54 +0000 (15:04 +0100)
Don't use the var_SetTime hack anymore and don't flush the fifo when
it's not necessary.
Fix #5967 and #2855

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/demux/mkv/mkv.cpp
modules/demux/mkv/virtual_segment.cpp

index 104cac804e01466cf21495c86d2b188addce8937..eedeba1019ca84c5117d3cf5b2143f1b828f1869 100644 (file)
@@ -668,7 +668,7 @@ static int Demux( demux_t *p_demux)
         if( p_sys->i_pts >= p_sys->i_start_pts  )
             if ( p_vsegment->UpdateCurrentToChapter( *p_demux ) )
             {
-                i_return = ( i_block_count != 0 );
+                i_return = 1;
                 break;
             }
 
@@ -694,7 +694,7 @@ static int Demux( demux_t *p_demux)
                     /* TODO handle successive chapters with the same user_start_time/user_end_time
                     */
                     p_sys->i_pts = p_chap->i_virtual_stop_time;
-                    p_sys->i_start_pts =  p_sys->i_pts++; // trick to avoid staying on segments with no duration and no content
+                    p_sys->i_pts++; // trick to avoid staying on segments with no duration and no content
 
                     i_return = 1;
                 }
@@ -704,7 +704,6 @@ static int Demux( demux_t *p_demux)
             else
             {
                 msg_Warn( p_demux, "cannot get block EOF?" );
-                es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
                 break;
             }
         }
index 0f667f2bb56ad16309b9b73532f8307f98274d26..d790357909b0ba12ee402548dba493a0374a422e 100644 (file)
@@ -386,8 +386,7 @@ bool virtual_segment_c::UpdateCurrentToChapter( demux_t & demux )
                         ( p_current_chapter->p_chapter->i_end_time != p_cur_chapter->p_chapter->i_start_time ) ||
                         ( p_current_chapter && p_current_chapter->p_segment != p_cur_chapter->p_segment ) )
                     {
-                        /* hack : we have to use input to seek in order to clean buffers */
-                        var_SetTime( demux.p_sys->p_input, "time", p_cur_chapter->i_virtual_start_time );
+                        Seek( demux, p_cur_chapter->i_virtual_start_time, 0, p_cur_chapter, -1 );
                         return true;
                     }
                 }
@@ -450,7 +449,6 @@ void virtual_segment_c::Seek( demux_t & demuxer, mtime_t i_date, mtime_t i_time_
 
         if( p_current_chapter->p_segment != p_chapter->p_segment )
         {
-            es_out_Control( demuxer.out, ES_OUT_RESET_PCR );
             p_chapter->p_segment->Select( i_date );
             p_current_chapter->p_segment->UnSelect();
         }