From 2a0e71f41fbf6c5fcde8dc286b16ccfd23061236 Mon Sep 17 00:00:00 2001 From: eddyg Date: Fri, 8 May 2009 00:33:01 +0000 Subject: [PATCH] Fix timestamps on CC's they are now 100% ready and working. Thanks to j45 and ritsuka for their assistence in getting soft subs finally in HB. git-svn-id: svn://localhost/HandBrake/trunk@2403 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- libhb/muxmp4.c | 5 ++--- libhb/sync.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index 0f06deb1..f6c46229 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -657,7 +657,6 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data, hb_error("Failed to write to output file, disk full?"); *job->die = 1; } - hb_log("Subtitle not due yet, adding delay of %lld", buf->start - m->sum_sub_duration); m->sum_sub_duration += buf->start - m->sum_sub_duration; } @@ -680,9 +679,9 @@ static int MP4Mux( hb_mux_object_t * m, hb_mux_data_t * mux_data, } m->sum_sub_duration += (buf->stop - buf->start); - hb_log("MuxMP4:Sub:%lld:%lld:%lld: %s", buf->start, buf->stop, + hb_deep_log(3, "MuxMP4:Sub:%fs:%lld:%lld:%lld: %s", (float)buf->start / 90000, buf->start, buf->stop, (buf->stop - buf->start), buf->data); - hb_log("MuxMP4:Total time elapsed:%lld", m->sum_sub_duration); + hb_deep_log(3, "MuxMP4:Total time elapsed:%lld", m->sum_sub_duration); } } else diff --git a/libhb/sync.c b/libhb/sync.c index c5842148..eee4708f 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -449,13 +449,20 @@ static void SyncVideo( hb_work_object_t * w ) sub = NULL; break; } else { + /* + * Sync the subtitles to the incoming video, and use + * the matching converted video timestamp. + * + * Note that it doesn't appear that we need to convert + * timestamps, I guess that they were already correct, + * so just push them through for rendering. + * + */ if( sub->start < cur->start ) { uint64_t duration; duration = sub->stop - sub->start; sub = hb_fifo_get( subtitle->fifo_raw ); - sub->start = pv->next_start; - sub->stop = sub->start + duration; hb_fifo_push( subtitle->fifo_out, sub ); } else { sub = NULL; -- 2.11.0