]> granicus.if.org Git - handbrake/commitdiff
If we always require a buffer to be available on every fifo we'll eventually deadlock...
authorvan <vanj.hb@gmail.com>
Mon, 30 Jun 2008 04:32:49 +0000 (04:32 +0000)
committervan <vanj.hb@gmail.com>
Mon, 30 Jun 2008 04:32:49 +0000 (04:32 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1542 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/muxcommon.c

index 04e876a440c7be6f0e953011037c4488a32e3950..13a8992245a1ad3bab82508b5a3f37d9398ff065 100644 (file)
@@ -40,7 +40,11 @@ static hb_track_t * GetTrack( hb_list_t * list )
         buf    = hb_fifo_see( track2->fifo );
         if( !buf )
         {
-            return NULL;
+            // To make sure we don't camp on one fifo & prevent the others
+            // from making progress we take the earliest data of all the
+            // data that's currently available but we don't care if some
+            // fifos don't have data.
+            continue;
         }
         if( !track || buf->start < pts )
         {
@@ -142,10 +146,8 @@ static void MuxerFunc( void * _mux )
         if( !( track = GetTrack( list ) ) )
         {
             hb_snooze( thread_sleep_interval );
-//                     thread_sleep_interval += 1;
             continue;
         }
-//             thread_sleep_interval = MAX(1, (thread_sleep_interval - 1));
 
         buf = hb_fifo_get( track->fifo );
         if( job->pass == 0 || job->pass == 2 )