From e387772dc2a4316d88d41b528b6b2b16eccf32ba Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Thu, 15 May 2025 21:38:35 +0200 Subject: [PATCH] v4l2: Re-enable first buffer skip for jpeg types The workaround is typically needed with usb-cameras using jpeg streams. Re-enabling the skip shouldn't affect what the commit was trying to do, i.e. fix encoded streams like h264 etc. Fixes: bcf0c0cf8 (v4l2: only skip buffer for raw formats) --- 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 96ce68ff7..887094eff 100644 --- a/spa/plugins/v4l2/v4l2-utils.c +++ b/spa/plugins/v4l2/v4l2-utils.c @@ -1873,7 +1873,9 @@ static int spa_v4l2_stream_on(struct impl *this) spa_log_debug(this->log, "starting"); - if (port->current_format.media_subtype == SPA_MEDIA_SUBTYPE_raw) + if (port->current_format.media_subtype == SPA_MEDIA_SUBTYPE_raw || + port->current_format.media_subtype == SPA_MEDIA_SUBTYPE_mjpg || + port->current_format.media_subtype == SPA_MEDIA_SUBTYPE_jpeg) port->first_buffer = true; else port->first_buffer = false;