]> granicus.if.org Git - handbrake/commitdiff
Fix subtitle scan to work with new stream eof logic.
authorvan <vanj.hb@gmail.com>
Sat, 26 Jul 2008 21:22:17 +0000 (21:22 +0000)
committervan <vanj.hb@gmail.com>
Sat, 26 Jul 2008 21:22:17 +0000 (21:22 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1584 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/render.c
libhb/work.c

index 0fc5816a9b21d7c1d55a7633e007dd126d884798..1989199fb9fdff52a1ed58175d7f2155e85f8560 100644 (file)
@@ -208,13 +208,14 @@ int renderWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
     hb_buffer_t * in = *buf_in, * buf_tmp_in = *buf_in;
     hb_buffer_t * ivtc_buffer = NULL;
 
-    if(!in->data)
+    if( in->size <= 0 )
     {
         /* If the input buffer is end of stream, send out an empty one
          * to the next stage as well. Note that this will result in us
          * losing the current contents of the delay queue.
          */
-        *buf_out = job->indepth_scan? NULL : hb_buffer_init(0);
+        *buf_out = in;
+        *buf_in = NULL;
         return HB_WORK_DONE;
     }
 
index 243b6b2e79e335c97eedf7654e93f72423efc7eb..f7d050b6a575cd0b12cb7d4bf3414906e5cc4245 100644 (file)
@@ -659,7 +659,7 @@ static void do_job( hb_job_t * job, int cpu_count )
 
     // The muxer requires track information that's set up by the encoder
     // init routines so we have to init the muxer last.
-    job->muxer = hb_muxer_init( job );
+    job->muxer = job->indepth_scan? NULL : hb_muxer_init( job );
 
     done = 0;
     w = hb_list_item( job->list_work, 0 );
@@ -667,13 +667,11 @@ static void do_job( hb_job_t * job, int cpu_count )
     w->init( w, job );
     while( !*job->die )
     {
-        if( ( w->status = w->work( w, NULL, NULL ) ) == HB_WORK_DONE )
+        if ( !done && ( w->status = w->work( w, NULL, NULL ) ) == HB_WORK_DONE )
         {
             done = 1;
         }
-        if( done &&
-            final_w->status == HB_WORK_DONE &&
-            !hb_fifo_size( job->fifo_mpeg4 ) )
+        if( done && final_w->status == HB_WORK_DONE )
         {
             break;
         }