And handle setting it to GST_CLOCK_TIME_NONE as always aligning without
ever detecting a discont.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1956>
- if (G_UNLIKELY (diff >= max_sample_diff)) {
+ if (self->alignment_threshold > 0
+ && self->alignment_threshold != GST_CLOCK_TIME_NONE
+ && G_UNLIKELY (diff >= max_sample_diff)) {
if (self->discont_wait > 0) {
if (self->discont_time == GST_CLOCK_TIME_NONE) {
self->discont_time = start_time;
if (self->discont_wait > 0) {
if (self->discont_time == GST_CLOCK_TIME_NONE) {
self->discont_time = start_time;
self->next_offset = end_offset;
// Got a discont and adjusted, reset the discont_time marker.
self->discont_time = GST_CLOCK_TIME_NONE;
self->next_offset = end_offset;
// Got a discont and adjusted, reset the discont_time marker.
self->discont_time = GST_CLOCK_TIME_NONE;
+ } else if (self->alignment_threshold == 0) {
+ // Don't align, just pass through timestamps
} else {
// No discont, just keep counting
timestamp =
} else {
// No discont, just keep counting
timestamp =