From 65350b601e135e20148991fc7635aef02bd76cd8 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 5 Sep 2023 16:15:19 -0400 Subject: [PATCH] v4l2: bufferpool: Do not resize compressed buffer Avoid resizing compressed buffer to their maximum size. This fixes a regression that caused valid but very large streams to be generated. Fixes #2953 Part-of: --- subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c index 01d55c3d63..9c664741ce 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2bufferpool.c @@ -1303,6 +1303,9 @@ gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool, GstBuffer ** buffer, group->planes[i].bytesused, i, group->buffer.flags, GST_TIME_ARGS (timestamp), pool->num_queued, outbuf, old_buffer_state); + if (GST_VIDEO_INFO_FORMAT (&pool->caps_info) == GST_VIDEO_FORMAT_ENCODED) + break; + /* Ensure our offset matches the expected plane size, or image size if * there is only one memory */ if (group->n_mem == 1) {