OSDN Git Service

fix for duplicate chapters when encoding with ffmpeg.
authorvan <van@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 6 Jan 2008 23:07:01 +0000 (23:07 +0000)
committervan <van@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 6 Jan 2008 23:07:01 +0000 (23:07 +0000)
git-svn-id: svn://localhost/HandBrake/trunk@1169 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/work.c

index 09ebf7a..1ddea78 100644 (file)
@@ -762,10 +762,14 @@ static void work_loop( void * _w )
 
         w->work( w, &buf_in, &buf_out );
 
-        // Propogate any chapter breaks for the worker
-        if( buf_in && buf_out && buf_in->new_chap )
+        // Propagate any chapter breaks for the worker if and only if the
+        // output frame has the same time stamp as the input frame (any
+        // worker that delays frames has to propagate the chapter marks itself
+        // and workers that move chapter marks to a different time should set
+        // 'buf_in' to NULL so that this code won't generate spurious duplicates.)
+        if( buf_in && buf_out && buf_in->new_chap && buf_in->start == buf_out->start)
         {
-            hb_log("WORK: Copying Chapter Break");
+            hb_log("work %s: Copying Chapter Break @ %lld", w->name, buf_in->start);
             buf_out->new_chap = 1;
         }