diff options
author | John Stebbins <[email protected]> | 2019-07-11 12:24:27 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2019-07-11 12:24:27 -0700 |
commit | f87655ee243aca7b279ca7c1bce1f1c4885c4bf0 (patch) | |
tree | 3ffb41af21e5b3dfaa16cecec416053498bba9bc /libhb/sync.c | |
parent | 268e5b7ef6c214a2eb68a8dfcb3045ba26a1b756 (diff) |
decsrtsub: fix missing initial sub with p-to-p
If the p-to-p start time starts in the middle of a subtitle, that sub
was getting dropped. Only drop the sub if the *stop* time is after the
p-to-p *start* time
fixes https://github.com/HandBrake/HandBrake/issues/2176
Diffstat (limited to 'libhb/sync.c')
-rw-r--r-- | libhb/sync.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libhb/sync.c b/libhb/sync.c index 201bca65b..20663da1d 100644 --- a/libhb/sync.c +++ b/libhb/sync.c @@ -1605,7 +1605,14 @@ static void OutputBuffer( sync_common_t * common ) out_stream->frame_count); out_stream->frame_count++; } - if (buf->s.start < common->start_pts) + if (out_stream->type == SYNC_TYPE_SUBTITLE && + buf->s.stop > common->start_pts) + { + // Subtitle ends after start time, keep sub and + // adjust it's start time + buf->s.start = common->start_pts; + } + else if (buf->s.start < common->start_pts) { out_stream->next_pts = buf->s.start + buf->s.duration; hb_list_rem(out_stream->in_queue, buf); @@ -2133,6 +2140,7 @@ static void QueueBuffer( sync_stream_t * stream, hb_buffer_t * buf ) hb_job_t * job = stream->common->job; if (job->pts_to_start > 0) { + stream->common->start_pts = stream->common->pts_to_start = MAX(0, job->pts_to_start - job->reader_pts_offset); } |