]> git.sesse.net Git - vlc/commitdiff
Don't demux 5 blocks each time pf_demux is called
authorDenis Charmet <typx@dinauz.org>
Sat, 22 Mar 2014 19:20:06 +0000 (20:20 +0100)
committerDenis Charmet <typx@dinauz.org>
Sat, 22 Mar 2014 19:20:06 +0000 (20:20 +0100)
Close #2658

modules/demux/mkv/mkv.cpp

index 950fdfe198553216622a096618406efa249fa190..bb5711ee3ba71561045265c6ed2660a2ec7071d0 100644 (file)
@@ -705,8 +705,7 @@ static int Demux( demux_t *p_demux)
         vlc_mutex_unlock( &p_sys->lock_demuxer );
         return 0;
     }
-    int                i_block_count = 0;
-    int                i_return = 0;
+    int i_return = 0;
 
     for( ;; )
     {
@@ -792,14 +791,9 @@ static int Demux( demux_t *p_demux)
         BlockDecode( p_demux, block, simpleblock, p_sys->i_pts, i_block_duration, b_key_picture || b_discardable_picture );
 
         delete block;
-        i_block_count++;
 
-        // TODO optimize when there is need to leave or when seeking has been called
-        if( i_block_count > 5 )
-        {
-            i_return = 1;
-            break;
-        }
+        vlc_mutex_unlock( &p_sys->lock_demuxer );
+        return 1;
     }
 
     vlc_mutex_unlock( &p_sys->lock_demuxer );