]> git.sesse.net Git - vlc/commitdiff
MKV: Don't delete es at EOF in Demux() but in Close()
authorDenis Charmet <typx@dinauz.org>
Tue, 24 Jan 2012 00:24:49 +0000 (01:24 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Tue, 24 Jan 2012 00:40:18 +0000 (01:40 +0100)
Fix the second part of #5896

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

index 67af69ee4595af869df276326cbe0175e632226c..443c38c4bfb0c61bdf7865b86e78f1ab1e981335 100644 (file)
@@ -257,6 +257,13 @@ static void Close( vlc_object_t *p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys   = p_demux->p_sys;
+    virtual_segment_c *p_vsegment = p_sys->p_current_segment;
+    if( p_vsegment )
+    {
+        matroska_segment_c *p_segment = p_vsegment->CurrentSegment();
+        if( p_segment )
+            p_segment->UnSelect();
+    }
 
     delete p_sys;
 }
@@ -692,8 +699,6 @@ static int Demux( demux_t *p_demux)
             else
             {
                 msg_Warn( p_demux, "cannot get block EOF?" );
-                p_segment->UnSelect();
-
                 es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
                 break;
             }