diff options
author | John Stebbins <[email protected]> | 2016-05-17 13:42:50 -0600 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-05-17 13:42:50 -0600 |
commit | fd311280dba1530d3666c4a9bd4e98380833565b (patch) | |
tree | ce583274828bf821ed060102f141ea6e24bdf0f3 /libhb/sync.c | |
parent | 9d52fbd1cefebb9bea49246c8d04081a20a1fc4d (diff) |
sync: move chapter logging to sync.c
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index 8375edc61..2ee82e7a3 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -133,6 +133,8 @@ struct sync_common_s uint64_t st_counts[4]; uint64_t st_dates[4]; uint64_t st_first; + + int chapter; }; struct hb_work_private_s @@ -774,6 +776,27 @@ static void streamFlush( sync_stream_t * stream ) hb_buffer_list_append(&stream->out_queue, hb_buffer_eof_init()); } +static void log_chapter( sync_common_t *common, int chap_num, + int nframes, int64_t pts ) +{ + hb_chapter_t *c; + + if ( !common->job ) + return; + + c = hb_list_item( common->job->list_chapter, chap_num - 1 ); + if ( c && c->title ) + { + hb_log("sync: \"%s\" (%d) at frame %d time %"PRId64, + c->title, chap_num, nframes, pts); + } + else + { + hb_log("sync: Chapter %d at frame %d time %"PRId64, + chap_num, nframes, pts ); + } +} + #define TOP_FIRST PIC_FLAG_TOP_FIELD_FIRST #define PROGRESSIVE PIC_FLAG_PROGRESSIVE_FRAME #define REPEAT_FIRST PIC_FLAG_REPEAT_FIRST_FIELD @@ -1109,6 +1132,13 @@ static void OutputBuffer( sync_common_t * common ) { out_stream->max_frame_duration = buf->s.duration; } + if (out_stream->type == SYNC_TYPE_VIDEO && + buf->s.new_chap > common->chapter) + { + common->chapter = buf->s.new_chap; + log_chapter(common, buf->s.new_chap, out_stream->frame_count, + buf->s.start); + } hb_buffer_list_append(&out_stream->out_queue, buf); } } while (full); |