summaryrefslogtreecommitdiffstats
path: root/libhb/sync.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-04-06 16:53:32 +0000
committerjstebbins <[email protected]>2014-04-06 16:53:32 +0000
commit38ad952258cb9f8231f9e8093805bf21da6ca307 (patch)
treeca255f99facef20f0170a8e50ddb590a626f4ee7 /libhb/sync.c
parent0fb6f4a009f4d61b5695416d5bc7cd7c4405debf (diff)
pgssubs: fix pgs passthru
Subtitles were being dropped because of the new condition I added that drops subtitles when start == end. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6152 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/sync.c')
-rw-r--r--libhb/sync.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index 84eb1eac5..7181e444a 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -220,7 +220,11 @@ static void InitSubtitle( hb_job_t * job, hb_sync_video_t * sync, int i )
// Merge overlapping subtitles since mpv tx3g does not support them
sync->subtitle_sanitizer[i].merge = 1;
}
- if (subtitle->config.dest == PASSTHRUSUB)
+ // PGS subtitles don't need to be linked because there are explicit
+ // "clear" subtitle packets that indicate the end time of the
+ // previous subtitle
+ if (subtitle->config.dest == PASSTHRUSUB &&
+ subtitle->source != PGSSUB)
{
// Fill in stop time when it is missing
sync->subtitle_sanitizer[i].link = 1;
@@ -320,7 +324,7 @@ static hb_buffer_t * mergeSubtitles(subtitle_sanitizer_t *sanitizer, int end)
{
b = a->next;
- if (b != NULL && !sanitizer->merge)
+ if (!sanitizer->merge)
{
sanitizer->list_current = a->next;
if (sanitizer->list_current == NULL)
@@ -406,6 +410,18 @@ static hb_buffer_t * sanitizeSubtitle(
if (!sanitizer->link && !sanitizer->merge)
{
+ if (sub != NULL)
+ {
+ if (sub->s.stop != AV_NOPTS_VALUE)
+ sub->s.duration = sub->s.stop - sub->s.start;
+ else
+ sub->s.duration = 0;
+ sub->s.start -= pv->common->video_pts_slip;
+ if (sub->s.stop != AV_NOPTS_VALUE)
+ sub->s.stop -= pv->common->video_pts_slip;
+ if (sub->s.renderOffset != AV_NOPTS_VALUE)
+ sub->s.renderOffset -= pv->common->video_pts_slip;
+ }
return sub;
}