From bcf0c0cf89f680078dcfdd70f3561855cfe880b7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 23 Apr 2025 11:09:54 +0200 Subject: [PATCH] v4l2: only skip buffer for raw formats We don't want to skip the first buffer for encoded formats because it can contain the encoding parameters, in the h264 case, for example. --- spa/plugins/v4l2/v4l2-utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spa/plugins/v4l2/v4l2-utils.c b/spa/plugins/v4l2/v4l2-utils.c index be38ab32d..96ce68ff7 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1873,7 +1873,10 @@ static int spa_v4l2_stream_on(struct impl *this) spa_log_debug(this->log, "starting"); - port->first_buffer = true; + if (port->current_format.media_subtype == SPA_MEDIA_SUBTYPE_raw) + port->first_buffer = true; + else + port->first_buffer = false; mmap_read(this); type = V4L2_BUF_TYPE_VIDEO_CAPTURE;