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 018A8465F2 for ; Mon, 22 May 2023 22:18:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0961368C0B4; Tue, 23 May 2023 01:18:34 +0300 (EEST) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1DE7968B8D2 for ; Tue, 23 May 2023 01:18:27 +0300 (EEST) Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6af6df840ffso1577109a34.1 for ; Mon, 22 May 2023 15:18:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684793905; x=1687385905; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=uLHNf6bGtrgcSx/fohkRwMqvAjG65mW83gVA5vMaQas=; b=BayYBn3RMih63mdQ1V3EU7nb/9kC14QxJ6HLKv9JmQ+yy+qa/WgGyEXLdg/c3ivdvy VZ4RcH/Gha+9162sAHHP+8Z12scpCfYk50+7qsF5jAJVlvY/+i/PiPvLSJQmmlKnMRYL WqbXKaqDS0Rk3qhofLhq4faMVFSWFuViPtBH0ianVryR+lXPJi3tD8ILLjjk0CZ2jo1j s+X3PoEpVkDD5S+nq5dg22E4MexXyRPFw5RB8PhhUsVxyweC+ui4Q1K98I/PtROX3boe xdSGbgo4QcB3kTXIxgQXWD4OP7+cVjxoAZjw2kt1vuo6/I98+czv1sjc420P7esJYkqp uzKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684793905; x=1687385905; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uLHNf6bGtrgcSx/fohkRwMqvAjG65mW83gVA5vMaQas=; b=YqLjb4FLW+khumIYuECh29f/d+lrex4h5xTd7tsa9E09cCbnpN4zRaQgVbZYRPXFSn BlEYoULh7VlkwrGViduJmCyuwkLC+6tjXLIuqgyBwOUQ08EaDuFplnfSoFwrItPM53hC IP47M+fbBjwvpaLLgAKSEd24DkW3NwNRsXNjiUIm6anugBOD5m2TYE+jyiQKrASJMltF bu1bA506s9aaaVoV8GnWQPiwqqTz45UvBN8pObTZu0UWH+vPbshrYC8U1yxmwTgnc4Rr agFDrZADZ0+s0pnj+aypP2X1nbzYJHKqoF3nBA0QDPLR1o7RU7NoGdZ0up9c5+vPrAA0 pLVw== X-Gm-Message-State: AC+VfDxTUrHZQBxDybCpASsgJ7LwPHeWyDPjDPAEnbqK8uWOBP+xXjkm z6/mdImQm7ixCrF+xUJJMtywsg+tpu8= X-Google-Smtp-Source: ACHHUZ6IHAfAyXZQ9lWJUAhUaPoWeVkRfZodCXzHdoRCQiDTtrkzv2NqrQiWCnFVl/h0tD+fUj0XIg== X-Received: by 2002:a05:6830:1bc6:b0:6a5:ff72:4fea with SMTP id v6-20020a0568301bc600b006a5ff724feamr6048065ota.29.1684793904754; Mon, 22 May 2023 15:18:24 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id p16-20020a0568301d5000b006a44338c8efsm2867860oth.44.2023.05.22.15.18.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 May 2023 15:18:24 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 May 2023 19:18:26 -0300 Message-Id: <20230522221826.3124-1-jamrial@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg_dec: abort if avcodec_send_packet() returns EAGAIN 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 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: As the comment in the code mentions, EAGAIN is not an expected value here because we call avcodec_receive_frame() until all frames have been returned. avcodec_send_packet() returning EAGAIN means a packet is still buffered, which hints that the underlying decoder is buggy and not fetching packets as it should. An example of this behavior was in the libdav1d wrapper before f209614290, where feeding it split frames (or individual OBUs) would result in the CLI eventually printing the unuseful "Error submitting packet to decoder: Resource temporarily unavailable" error message, and just keep until EOF without returning new frames. Signed-off-by: James Almer --- fftools/ffmpeg_dec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index e06747d9c4..85064f061a 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -390,6 +390,11 @@ int dec_packet(InputStream *ist, const AVPacket *pkt, int no_eof) if (ret < 0 && !(ret == AVERROR_EOF && !pkt)) { // In particular, we don't expect AVERROR(EAGAIN), because we read all // decoded frames with avcodec_receive_frame() until done. + if (ret == AVERROR(EAGAIN) { + av_log(ist, AV_LOG_FATAL, "A decoder returned an unexpected error code. " + "This is a bug, please report it.\n"); + exit_program(1); + } av_log(ist, AV_LOG_ERROR, "Error submitting %s to decoder: %s\n", pkt ? "packet" : "EOF", av_err2str(ret)); if (exit_on_error) -- 2.40.1 _______________________________________________ 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".