From patchwork Thu Jul 13 10:55:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 42656 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6da1:b0:131:a7d0:bc6d with SMTP id gl33csp2823899pzb; Thu, 13 Jul 2023 04:01:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlGGVY3T2HaBeHw4UGfR1Kbgxx2UAnRi6VnA811HzWuWFz7B33qaiN9Mau2HfHtHJYYZ5/2U X-Received: by 2002:a17:906:24f:b0:993:ffcb:ad56 with SMTP id 15-20020a170906024f00b00993ffcbad56mr1410313ejl.10.1689246066955; Thu, 13 Jul 2023 04:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689246066; cv=none; d=google.com; s=arc-20160816; b=rECN7GInxV7cLW0r1frpTM8h3MlXc9PUcS5yXWKKdFe/neyGyFTKuK/19/y5QKQGv5 SxXKj11TCZPOV7AbGl7lM5aJXVjVlGIo7h2bdlzX2QNY4U/cTkWbH0opyrybAaLIbxCp Z25QDzr2oK7VzMNee72/Bd7XFe3hRUtqt/4fe0Ha+QaP85V+A/PZZ5/xKloShtaEWHZV 5ShvOubbgxsrW/cCcEPZfVNG7cllodOmT4jn4d3sB1Kgyj2mTQo4gO18fToI2qxm/7FS spT1V5dnslWcvJE+guYoSeFTYP8uzRWqjFGd5ca9jAaDUakpvDvMJWaKtR4ITJfdhHcs rOhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=X03821QJt2OGarahyMeCEDsKsctqRtpGqhSUzJ17mrM=; fh=8ZF2QtiKOjBtyn9wuO2cMeZaLsE4aq02Bq77gGK61E8=; b=cKv4uMdfHa1Mj+sDsFAH7+D8bL0MFYLrvAU6vTkrO6lYrPB6RbA0KJvIYJnhxV3za4 KnqcO80FNppLYuqMJ+rGG8mGgfy1ntK8YomGNXmNROzOOQATiQIMyf/BeV5Uw8sYqMLd nay65PtV+L4b0roToDy+gS8BX4SpjII5+Hk49TLv6PJ1X3uitiZqllkIEeWZiL3fCXYa 3usiIe2Air3q1fvBY1QmsaC8AQFteJq8GF/ybP0efOjtmYD9LfYN6lhwx64y+UT+1pTh 18IxtzHmO7fuZcJyFMeCb0aYVhsM99R+TMFq61By5Avz+4rkL9oslTW0MsNU+L5k0L2I 7sIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y2-20020a1709060a8200b0099318359ea8si6994087ejf.452.2023.07.13.04.01.06; Thu, 13 Jul 2023 04:01:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 86A9968C717; Thu, 13 Jul 2023 13:58:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0788C68C6A4 for ; Thu, 13 Jul 2023 13:57:49 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id DFCA62404EE for ; Thu, 13 Jul 2023 12:57:47 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id Q76JzpLa-77G for ; Thu, 13 Jul 2023 12:57:47 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 9760E2406CE for ; Thu, 13 Jul 2023 12:57:41 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id D61EE3A1A05 for ; Thu, 13 Jul 2023 12:57:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 13 Jul 2023 12:55:40 +0200 Message-Id: <20230713105553.21052-20-anton@khirnov.net> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230713105553.21052-1-anton@khirnov.net> References: <20230713105553.21052-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 20/33] fftools/ffmpeg: handle error codes from process_input_packet() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ySuctzIxiIws None are returned for now, but that will change in future commits. --- fftools/ffmpeg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 68924d21e0..dd7cfcf632 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1103,6 +1103,8 @@ static int process_input(int file_index) ret = process_input_packet(ist, NULL, 0); if (ret>0) return 0; + else if (ret < 0) + return ret; } /* mark all outputs that don't go through lavfi as finished */ @@ -1124,11 +1126,11 @@ static int process_input(int file_index) sub2video_heartbeat(ifile, pkt->pts, pkt->time_base); - process_input_packet(ist, pkt, 0); + ret = process_input_packet(ist, pkt, 0); av_packet_free(&pkt); - return 0; + return ret < 0 ? ret : 0; } /** @@ -1219,7 +1221,8 @@ static int transcode(int *err_rate_exceeded) float err_rate; if (!input_files[ist->file_index]->eof_reached) { - process_input_packet(ist, NULL, 0); + int err = process_input_packet(ist, NULL, 0); + ret = err_merge(ret, err); } err_rate = (ist->frames_decoded || ist->decode_errors) ?