In order to make the discontinuity detection code useful, we need to
detect the lost frames in the history as early as the previous frame.
This is because some VA implementations only support one reference
frame for advanced deinterlacing.
In practice, turn the condition for detecting new frame that is beyond
the previous frame from field_duration*2 to field_duration*3, i.e.
nothing received for the past frame and a half because of possible
rounding errors when calculating the field-duration either in this
element (vaapipostproc), or from the upstream element (parser element).
This is a regression introduced with commit
faefd62.
https://bugzilla.gnome.org/show_bug.cgi?id=734135
if (prev_buf && (prev_pts = GST_BUFFER_TIMESTAMP(prev_buf)) != pts) {
const GstClockTimeDiff pts_diff = GST_CLOCK_DIFF(prev_pts, pts);
if (pts_diff < 0 || (postproc->field_duration > 0 &&
- pts_diff > postproc->field_duration * 2))
+ pts_diff >= postproc->field_duration * 3 - 1))
ds_reset(ds);
}
}