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 C340C457FD for ; Wed, 24 May 2023 11:32:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9499268C07C; Wed, 24 May 2023 14:31:57 +0300 (EEST) Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C7CD368BE7A for ; Wed, 24 May 2023 14:31:50 +0300 (EEST) Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-554f951e658so465538eaf.0 for ; Wed, 24 May 2023 04:31:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684927909; x=1687519909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=P4kS73ljQyAt/r6iOxxljF+9oR2gActvd+NWQCXqq60=; b=ETzNI4DhO4FcjhFcfJSVUGvOQDz03c+JHroMcvlPI2CX2+Y9b5pP5YLIgDaJowGUz4 n8Eu97elUCWASyQhIRfoYA2B45QNKBF5US6Y0XlVWbnhkYKnGrM/eiURsbcrarbCtTXg PUt3yqexJYHRHYPfGzt2p+1LvB9j74XyFo/ZAnqfh/dI+LFz0MvFrtotncAgnpfkR8fa /c6dbTKaz3EaJumweVrFxig9bnx9raJCGC/Mqezkd4o25CsnUAEjZrTC6NebSVDL00+B EgnaXbb87ZqGK7XLQd+VCO32Mq0rjh63Ns6CgamSgnFMu8Nzth9jiYkY4XCJb1Hih39p YODw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684927909; x=1687519909; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P4kS73ljQyAt/r6iOxxljF+9oR2gActvd+NWQCXqq60=; b=j6pQqN7sNLSl9n8nn8dr6IdZgxzlUE5HVBnQgsvhCWWVjF6rIhUq5XkAPtEb9dvZrH zYZZSoVuJ1prbIUotajpZNv7L7mNqgUOrSnFMxTEJ50dwpS1QAcaRq02Bz0QnL83u8xv D2J9wwZisvz1wjqBouWSk1uoMbDxv23FD8qTzK1CFchG2s85mXTk+jGTNv4W8/R3F5Cw Z4hnVTwu6qE6Vn8L9woZUvPNu68lGxJuztdWBPJwIDxhr3dSSZl1amG/0K2/zpaZgOrL dychi8VFrHHyT/kzspkoZxuPveJNFSO+JiKjLY0L6M+KT0LFlxAVakTS7pLMhp9AB1R3 4W+Q== X-Gm-Message-State: AC+VfDxW4fSGH/yBsHS113AUXBPN2KHJlqn5VjxroSpL3TOCPsRzWGkg iZi8JvdlOAnxTRcFbwGtEUMjkb2o6+o= X-Google-Smtp-Source: ACHHUZ4ojwR2EQ8xsTwqmfWOYEBn3FkL0GcdmzpJeFaIZV/Zbdmlqb2xbo+7Kzaxa6+lw1RP6e+fOQ== X-Received: by 2002:a4a:614f:0:b0:54f:5e31:31c5 with SMTP id u15-20020a4a614f000000b0054f5e3131c5mr6678841ooe.2.1684927908750; Wed, 24 May 2023 04:31:48 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id w45-20020a4a97b0000000b0051ffe0fe11bsm4847459ooi.6.2023.05.24.04.31.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 04:31:48 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 May 2023 08:31:54 -0300 Message-Id: <20230524113154.1508-1-jamrial@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230522221826.3124-1-jamrial@gmail.com> References: <20230522221826.3124-1-jamrial@gmail.com> 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 --- Now compiling. fftools/ffmpeg_dec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index e06747d9c4..b1db9b30d0 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".