With older kernel, older driver or just broken drivers, the sequence number
may not be increasing. This simply ignore the sequence in this case. This
would otherwise miss-leading large amount of lost frame being reported.
Fixes #729
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/598>
/* use generated offset values only if there are not already valid ones
* set by the v4l2 device */
if (!GST_BUFFER_OFFSET_IS_VALID (*buf)
- || !GST_BUFFER_OFFSET_END_IS_VALID (*buf)) {
+ || !GST_BUFFER_OFFSET_END_IS_VALID (*buf)
+ || GST_BUFFER_OFFSET (*buf) <=
+ (v4l2src->offset - v4l2src->renegotiation_adjust)) {
GST_BUFFER_OFFSET (*buf) = v4l2src->offset;
GST_BUFFER_OFFSET_END (*buf) = v4l2src->offset + 1;
if (!half_frame || !v4l2src->next_offset_same)