]> granicus.if.org Git - handbrake/commitdiff
work: fix hang in p-to-p encoding
authorJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 14 Jan 2016 20:28:54 +0000 (13:28 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 14 Jan 2016 20:28:54 +0000 (13:28 -0700)
libhb/work.c

index a21481a7cbd0c59c57f9c2e87ea3dbd48bf3f1c8..7a8f1ee192d157f55e48387057c6e51bfc9f7081 100644 (file)
@@ -1877,6 +1877,15 @@ void hb_work_loop( void * _w )
     {
         hb_buffer_close( &buf_out );
     }
+
+    // Consume data in incoming fifo till job complete so that
+    // residual data does not stall the pipeline
+    while (!*w->done && w->fifo_in != NULL)
+    {
+        buf_in = hb_fifo_get_wait( w->fifo_in );
+        if ( buf_in != NULL )
+            hb_buffer_close( &buf_in );
+    }
 }
 
 /**