OSDN Git Service

Apply same edit to chapter track as to video track so chapters will stay in
authorvan <van@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 6 Jan 2008 23:01:44 +0000 (23:01 +0000)
committervan <van@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 6 Jan 2008 23:01:44 +0000 (23:01 +0000)
sync with the video (otherwise they end up 2-4 frames late).

git-svn-id: svn://localhost/HandBrake/trunk@1168 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/muxmp4.c

index 2a39d05..adbd2c5 100644 (file)
@@ -480,6 +480,13 @@ static int MP4End( hb_mux_object_t * m )
            // the rendering offset of the first sample.
            MP4AddTrackEdit(m->file, 1, MP4_INVALID_EDIT_ID, MP4GetSampleRenderingOffset(m->file,1,1),
                MP4GetTrackDuration(m->file, 1), 0);
+            if ( m->job->chapter_markers )
+            {
+                // apply same edit to chapter track to keep it in sync with video
+                MP4AddTrackEdit(m->file, m->chapter_track, MP4_INVALID_EDIT_ID,
+                                MP4GetSampleRenderingOffset(m->file,1,1),
+                                MP4GetTrackDuration(m->file, m->chapter_track), 0);
+            }
      }
 
     MP4Close( m->file );