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 938AE45C35 for ; Thu, 27 Jul 2023 19:21:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2BA8B68CAA9; Thu, 27 Jul 2023 22:21:43 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 10B9D68C905 for ; Thu, 27 Jul 2023 22:21:36 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 2B3A6E9201; Thu, 27 Jul 2023 21:18:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PLSb4R7Yw5dy; Thu, 27 Jul 2023 21:18:38 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 697CCE91F3; Thu, 27 Jul 2023 21:18:38 +0200 (CEST) Date: Thu, 27 Jul 2023 21:18:38 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20230725213838.199190-2-mailingradian@gmail.com> Message-ID: <1fd88bea-9395-ff36-1b92-bee98327225@passwd.hu> References: <20230725213838.199190-2-mailingradian@gmail.com> MIME-Version: 1.0 Subject: Re: [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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 25 Jul 2023, Richard Acayan wrote: > 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. Will apply, thanks. Marton > > 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". > _______________________________________________ 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".