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 2DD0346F0F for ; Sat, 22 Jul 2023 01:46:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BBF1868C572; Sat, 22 Jul 2023 04:46:34 +0300 (EEST) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4CE1468C39F for ; Sat, 22 Jul 2023 04:46:28 +0300 (EEST) Received: by mail-qt1-f169.google.com with SMTP id d75a77b69052e-403b3213d8aso21275461cf.0 for ; Fri, 21 Jul 2023 18:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689990386; x=1690595186; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MbYXd7PzuR60LHRwBVYF7/FF2Cx9XtfArNXtIBVfv50=; b=r36Jq19x03QIenHAyVIeZEWZS1lra3JmVp8L2Q2j91vSpd9JnkJXk1r3Uesp6qSBiR g8XPeIefB6aOL95fB8amAWOYtoHA9j9UeTIMd/B/LYjaF1xO66CYYhiwSOq5sP1ahkCJ Kbmjb/48MNmRRG1PK2oh217ixAMvtIwRE5UuJblRXxWa5R5/1AZN8JwtAFtieSaTshDA BjRF542j1vOxrk0pHB2kBsu8t3i3UJ67Pgaqw2J2pGXdx0Y3w71b8dyxLjzMocNCPS8g U9dco0awhdhMWxdoKGV5FzyV3wR2veq1qwkww8UzN8zKJSHrU1pgeLBG6ANR8oly8Xpz FMCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689990386; x=1690595186; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MbYXd7PzuR60LHRwBVYF7/FF2Cx9XtfArNXtIBVfv50=; b=ilZL7E24RAaMZc04DYmsan5HdTtZAfeWtdTA+xFijBvDrBq9tDAykforfBQ92pQIX8 Q9yrViviOuZFsUSEB0WL6jSY6F3D4hfXLydCX0F5lg57SboXmGgqc4mpIzCLxFi5711r edjqZQfrQLIXRvdD4gv9zGyDpfpwvjDPgl+JtoL6DSlzJo9fk+MIPNYNntsG3hLooJRs LY1Cq6OAXXb9Sl2esW0Uz9h8DT8+Sd1BiSvS9Bnu3suFELI+upajY6yJWpzTSiVW9iDV pPXZCsNNzj38lNbsRUQTLNZAZzdMw2NTo61RI6AY7wXZW30zEwBcTU7nKxk8arYsfyKy vbLw== X-Gm-Message-State: ABy/qLar0gXX87H6gym3KRbvoZHesbGDca8DeQzbsGsFo5at4FvWp0Xn 0ViB6pYaLzf0WXE1N0z9FK0tyCpdMi0= X-Google-Smtp-Source: APBJJlGzijAVAmAzMsK/LLdEcZBLCxL76hnXoEN2DOUWHY2hc/lnodmnwsqrRau/kbg7YhuvMvcyYw== X-Received: by 2002:a05:622a:18a:b0:403:eb5b:1f6 with SMTP id s10-20020a05622a018a00b00403eb5b01f6mr1923651qtw.63.1689990385946; Fri, 21 Jul 2023 18:46:25 -0700 (PDT) Received: from localhost ([2607:fea8:529e:7800::7cda]) by smtp.gmail.com with ESMTPSA id f4-20020ac81344000000b0040353ea0827sm1670832qtj.56.2023.07.21.18.46.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jul 2023 18:46:25 -0700 (PDT) Date: Fri, 21 Jul 2023 21:46:22 -0400 From: Richard Acayan To: ffmpeg-devel@ffmpeg.org Message-ID: References: <20230718220017.3336-1-mailingradian@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230718220017.3336-1-mailingradian@gmail.com> Subject: Re: [FFmpeg-devel] [RESEND PATCH] avcodec/v4l2_context: always log 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: Will this patch be applied or receive any comments? I have been waiting more than 2 weeks since the original submission (https://ffmpeg.org/pipermail/ffmpeg-devel/2023-July/311580.html) and have not received a response since. I am trying to get mpv to work again with the v4l2_m2m codec, as it started emitting segmentation faults. This is partly due to some incorrect usage of libavcodec in mpv, and partly due to the error/warning handling in libavcodec. An mpv maintainer dismissed this as a bug in ffmpeg, and this change is simpler than what mpv would need for a fix, so I am hoping that this patch goes in. I don't have write access so I can't apply it myself, even if there are no objections. On Tue, Jul 18, 2023 at 06:00:17PM -0400, Richard Acayan wrote: > The error handler for POLLERRs assumes that the timeout is only zero > when v4l2_dequeue_v4l2buf is called by v4l2_getfree_v4l2buf. This > assumption is incorrect, as ff_v4l2_context_dequeue_frame also calls > this function with a timeout of zero. Do not check for unavailable > buffers if the buffers are uninitialized. > > See https://trac.ffmpeg.org/ticket/9957 for the original bug report. > > Signed-off-by: Richard Acayan > --- > libavcodec/v4l2_context.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c > index a40be94690..69ddf80723 100644 > --- a/libavcodec/v4l2_context.c > +++ b/libavcodec/v4l2_context.c > @@ -327,7 +327,7 @@ start: > 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 (timeout == 0) { > + if (timeout == 0 && ctx->buffers) { > 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".