From b2ce24e20ecada18c0550355d3a367e20600093f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 4 Sep 2024 16:57:07 +0200 Subject: [PATCH] v4l2: queue dropped first buffer again When we drop the first buffer to avoid timestamp problems, queue it again in the driver or else we will not be able to dequeue is again later and we will be running with a buffer less. --- spa/plugins/v4l2/v4l2-utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index 097ad8d0e..2a8965a7b 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1401,8 +1401,10 @@ static int mmap_read(struct impl *this) /* Drop the first frame in order to work around common firmware * timestamp issues */ - if (buf.sequence == 0) + if (buf.sequence == 0) { + xioctl(dev->fd, VIDIOC_QBUF, &buf); return 0; + } pts = SPA_TIMEVAL_TO_NSEC(&buf.timestamp); spa_log_trace(this->log, "v4l2 %p: have output %d", this, buf.index);