From f9eed5843c552165dfc42a0c94c8eac834bcc0ed 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 cb48e9f69..79c509a07 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1403,8 +1403,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);