[vlc-commits] Don't demux 5 blocks each time pf_demux is called

Denis Charmet git at videolan.org
Sat Mar 22 20:21:17 CET 2014


vlc | branch: master | Denis Charmet <typx at dinauz.org> | Sat Mar 22 20:20:06 2014 +0100| [bbbc5b5223d887801678a354f85d519dcdd6faf9] | committer: Denis Charmet

Don't demux 5 blocks each time pf_demux is called

Close #2658

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

 modules/demux/mkv/mkv.cpp |   12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index 950fdfe..bb5711e 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -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 );



More information about the vlc-commits mailing list