From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id CCECF4706D for ; Tue, 25 Jul 2023 21:41:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C430068C858; Wed, 26 Jul 2023 00:41:26 +0300 (EEST) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B04668C6CF for ; Wed, 26 Jul 2023 00:41:20 +0300 (EEST) Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-403af7dfa3aso51600271cf.0 for ; Tue, 25 Jul 2023 14:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690321279; x=1690926079; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=s1zGEL8CKFLAbTGRsJZZ0ZhtLR9Gx2MX8DFUdJgOzeM=; b=LTsTZtF+SJ3r3XMGd3sXNt/WhuXK7qJE+NxDsCRBJnVtZftELO5Cuh9D+nKP0t265y qQJGNBvpUZr6E7kJwhNRFd/alJpvUii5FcBxnCQufagTYUx85Q9pRpa+swvRAek6y+yE an9poPQztdDJWUEtE/opUZE/TcjE1aM1+5GH4IggN9ePLGgjuC0NTaT5Gdfbe5FnaoSh 0B38LQKyWULELcilG093IiTsXrKssD/06HfUv79Ks4Q1NRV2/WT6fp1u77Xx6+loypkg wkmTRt5M66y0Vo/Dg3XpNAKMWR2rQISbxtEh1gVQ3JbE4TTAUFlC/zn0dYs05MRiLcLV C3Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690321279; x=1690926079; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s1zGEL8CKFLAbTGRsJZZ0ZhtLR9Gx2MX8DFUdJgOzeM=; b=af3A6nwRb3g09ZDbzk0uB8dO7SXDtUGyuMA/uyDes4SRujB1xg7+k+pWjenmMjTDZY N03LgODkLuKJ5nE0ZSWUCj3UNdRhCrVptz0vI9pmbfeqpPbfaKNngpCZFuczLrz3Ot5r 0Wz5LgxSWOaLd1xxuLNTPlolQTAkvSdbZF2FNGwfOFW3bXfEuB1qSYnxGwTwJwu9tjsQ 4Emu2PGYwY3TvM/+lxpNsLDhKuYPrceGTZKDxOKLyhiY6CeM0da5BfoPgnrpFvvM9GEP LjFECE9/y8/8+Z+hrhLBjqX6tMSw2S0+yJJGxiCu+uMXUrPwLC3XpDiC/I1AIT56p+Qp Otmw== X-Gm-Message-State: ABy/qLa5OR/J+HNqZOtS3OcpnDVwk0BY8x6Q/eKczp31hWxR5uJKg1dp 6etRzBwypanajAHagZ1hzzrjpstQvI0+2w== X-Google-Smtp-Source: APBJJlF34XDTyf+m6hSgU745CLoU2R351+8rMznTLo8gFWJZtY+q+ZBr556Lxv1rt6QUaZyK7UTf+g== X-Received: by 2002:ac8:5f8c:0:b0:403:b88d:1e60 with SMTP id j12-20020ac85f8c000000b00403b88d1e60mr248435qta.51.1690321278732; Tue, 25 Jul 2023 14:41:18 -0700 (PDT) Received: from localhost ([2607:fea8:529e:7800::7c90]) by smtp.gmail.com with ESMTPSA id j7-20020ac84c87000000b00401e04c66fesm4333953qtv.37.2023.07.25.14.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jul 2023 14:41:18 -0700 (PDT) From: Richard Acayan To: FFmpeg development discussions and patches Date: Tue, 25 Jul 2023 17:38:39 -0400 Message-ID: <20230725213838.199190-2-mailingradian@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] avcodec/v4l2_context: suppress POLLERR when buffers are uninitialized X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Richard Acayan Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: A POLLERR occurs when libavcodec attempts to dequeue output buffers before enqueuing capture buffers. This could happen to an application deciding to send the first coded packet. Suppress these POLLERRs when the buffers are uninitialized. See https://trac.ffmpeg.org/ticket/9957 for the original bug report. Signed-off-by: Richard Acayan --- Changes since v1 (20230718220017.3336-1-mailingradian@gmail.com): - stopped emitting POLLERR logs for this case (thanks to feedback from Marton Balint) libavcodec/v4l2_context.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c index a40be94690..f20f713e1d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -325,9 +325,13 @@ start: /* 0. handle errors */ if (pfd.revents & POLLERR) { - /* if we are trying to get free buffers but none have been queued yet - no need to raise a warning */ + /* if we are trying to get free buffers but none have been queued yet, + * or if no buffers have been allocated yet, no need to raise a warning + */ if (timeout == 0) { + if (!ctx->buffers) + return NULL; + for (i = 0; i < ctx->num_buffers; i++) { if (ctx->buffers[i].status != V4L2BUF_AVAILABLE) av_log(logger(ctx), AV_LOG_WARNING, "%s POLLERR\n", ctx->name); -- 2.41.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".