summaryrefslogtreecommitdiffstats
path: root/libhb/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/sync.c')
-rw-r--r--libhb/sync.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index 4d2e88a82..154346f48 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -2587,18 +2587,22 @@ static hb_buffer_t * mergeSubtitles(sync_stream_t * stream)
if (!sanitizer->merge)
{
- int limit = sanitizer->link ? 1 : 0;
-
// Handle all but the last buffer
// The last buffer may not have been "linked" yet
- while (hb_buffer_list_count(&sanitizer->list_current) > limit)
+ while (hb_buffer_list_count(&sanitizer->list_current) > 0)
{
- buf = hb_buffer_list_rem_head(&sanitizer->list_current);
- if (!(buf->s.flags & HB_BUF_FLAG_EOF))
+ buf = hb_buffer_list_head(&sanitizer->list_current);
+ if (!(buf->s.flags & HB_BUF_FLAG_EOF) &&
+ buf->s.stop != AV_NOPTS_VALUE)
{
+ buf = hb_buffer_list_rem_head(&sanitizer->list_current);
buf = setSubDuration(stream, buf);
hb_buffer_list_append(&list, buf);
}
+ else
+ {
+ break;
+ }
}
return hb_buffer_list_clear(&list);
}