]> git.sesse.net Git - vlc/commitdiff
mkv.cpp: don't decode frames when they shouldn't be
authorSteve Lhomme <robux@videolan.org>
Mon, 16 May 2005 21:07:27 +0000 (21:07 +0000)
committerSteve Lhomme <robux@videolan.org>
Mon, 16 May 2005 21:07:27 +0000 (21:07 +0000)
modules/demux/mkv.cpp

index afd09e106b06f2481dda415d8f7b4a7451706b77..a53c6d6752f107325d801099f81c37c98c79b6eb 100644 (file)
@@ -3167,6 +3167,32 @@ static int Demux( demux_t *p_demux)
             es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pts );
         }
 
+        if( p_sys->i_pts >= p_sys->i_start_pts  )
+            if ( p_vsegment->UpdateCurrentToChapter( *p_demux ) )
+            {
+                i_return = 1;
+                break;
+            }
+        
+        if ( p_vsegment->Edition() && p_vsegment->Edition()->b_ordered && p_vsegment->CurrentChapter() == NULL )
+        {
+            /* nothing left to read in this ordered edition */
+            if ( !p_vsegment->SelectNext() )
+                break;
+            p_segment->UnSelect( );
+            
+            es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
+
+            /* switch to the next segment */
+            p_segment = p_vsegment->Segment();
+            if ( !p_segment->Select( 0 ) )
+            {
+                msg_Err( p_demux, "Failed to select new segment" );
+                break;
+            }
+            continue;
+        }
+
         BlockDecode( p_demux, block, p_sys->i_pts, i_block_duration );
 
         delete block;