v4l2src: Ignore non-increasing sequence number

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>
This commit is contained in:
Nicolas Dufresne 2020-05-20 17:30:59 -04:00 committed by GStreamer Merge Bot
parent 8a8c8afc86
commit bfb1506381

View file

@ -978,7 +978,9 @@ retry:
/* 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)