summaryrefslogtreecommitdiffstats
path: root/libhb/sync.c
diff options
context:
space:
mode:
authorvan <[email protected]>2008-04-04 16:49:33 +0000
committervan <[email protected]>2008-04-04 16:49:33 +0000
commit7bde7810e9f4a32aae494a151a3ec2577b201db6 (patch)
tree130ea103845172eb247b3ed01219288324221ab0 /libhb/sync.c
parent8f7e4cf3d5a6a8fdd5557c1d5f54083ba942c9aa (diff)
Minor chapter cleanups.
- put chapter number in buf rather than a 'new chapter' flag. - use that chapter number to index chapter text in muxers so a dropped chapter doesn't make all subsequent chapter labeling wrong. - get rid of most of the chapter logging & just output one line giving the chapter text, number, frame & time. - fix a bug in sync that could cause chapter marks to be lost. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1377 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r--libhb/sync.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index b787106f7..233863391 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -52,6 +52,7 @@ struct hb_work_private_s
int video_sequence;
int count_frames;
int count_frames_max;
+ int chap_mark; /* to propagate chapter mark across a drop */
hb_buffer_t * cur; /* The next picture to process */
/* Audio */
@@ -344,6 +345,11 @@ static int SyncVideo( hb_work_object_t * w )
}
++pv->drop_count;
buf_tmp = hb_fifo_get( job->fifo_raw );
+ if ( buf_tmp->new_chap )
+ {
+ // don't drop a chapter mark when we drop the buffer
+ pv->chap_mark = buf_tmp->new_chap;
+ }
hb_buffer_close( &buf_tmp );
continue;
}
@@ -521,6 +527,13 @@ static int SyncVideo( hb_work_object_t * w )
buf_tmp->start = pv->next_start;
pv->next_start += duration;
buf_tmp->stop = pv->next_start;
+ if ( pv->chap_mark )
+ {
+ // we have a pending chapter mark from a recent drop - put it on this
+ // buffer (this may make it one frame late but we can't do any better).
+ buf_tmp->new_chap = pv->chap_mark;
+ pv->chap_mark = 0;
+ }
/* If we have a subtitle for this picture, copy it */
/* FIXME: we should avoid this memcpy */