summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-03-03 14:19:36 -0700
committerJohn Stebbins <[email protected]>2017-03-03 14:29:19 -0700
commit31d0389758bd506a6c349d85c0d3191880d0dea4 (patch)
treeabe8a04b4d7422b300cf99b3c7aabc32f7b9b60a /libhb
parentc33ca187ddec9cf42378a289d7b4ff90996b948a (diff)
sync: fix small video dejitter error
This very small error snowballs into a crash in x264 :-p If the amount of jitter on the first frame in the queue was small (about 1 tick) then jitter would not be removed from that frame. This extra tick of jitter can appear on different frames depending on when frame arrives and how much has been queued. This very small amount of randomness lead to problems in the VFR filter. A frame duration difference as small as 1 tick can lead to an extra frame getting duplicated when doing CFR. When doing 2 pass encoding, this extra frame causes x264 to crash at the end of the 2nd pass.
Diffstat (limited to 'libhb')
-rw-r--r--libhb/sync.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libhb/sync.c b/libhb/sync.c
index f199feff8..ac30f7e28 100644
--- a/libhb/sync.c
+++ b/libhb/sync.c
@@ -554,6 +554,11 @@ static void dejitterVideo( sync_stream_t * stream )
if (ABS(duration - frame_duration) < 1.1)
{
// Ignore small jitter
+ buf->s.start = stream->next_pts + frame_duration;
+ buf = hb_list_item(stream->in_queue, 0);
+ buf->s.start = stream->next_pts;
+ buf->s.duration = frame_duration;
+ buf->s.stop = stream->next_pts + frame_duration;
return;
}