From patchwork Mon Aug 15 18:34:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 37294 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:3d0d:b0:8d:a68e:8a0e with SMTP id y13csp1432650pzi; Mon, 15 Aug 2022 11:34:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR7OdhCWQJbccaTTTr+2PCBiWI/3rk+utVLDFpm06vw/1UTTj05dHNotDaKQBV2bSrugH6OI X-Received: by 2002:a17:907:6eaa:b0:730:9fb6:41a5 with SMTP id sh42-20020a1709076eaa00b007309fb641a5mr11059547ejc.675.1660588493374; Mon, 15 Aug 2022 11:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660588493; cv=none; d=google.com; s=arc-20160816; b=aU4+p379Mjb8aAcAyjFnBouMXnaM9FOSVnDXK4/EAnG/sG878/qepFj+9Pli+kZ9Wz oAZf0y2VljSeay4QC7VcwuucGVI3FyZ4kRb88MuI8mnC7KNClkkoZDq1d3ZQeETcVFr/ Y3l/FtQCl1CRI8RUabfK6fIQ5bZnj5U7wg1Mqy6hQXK6FT3G6YG95pPvCxW9VsJ773cM A0dojtS2TNeXjcAvK61g/OuaOeNhLm6WDyZ8anOdezlh/wI8OnYZ6LbHGs4/EMQRF6Jm HSwBlpH6Oai65XhX77sweJYeUowvdO5Us0Ug5CpAD1Qssoo+PMgRi6+ZSG7jEfumaPnF ElMw== 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:message-id:date:to:from :delivered-to; bh=5Mn5bWQYHBECJUDJZMV1IClKJ9uVYg3tbMiJVYwMVUY=; b=tgYLhkcB+pxvRHLz7BGrlGDAvIhXdVqBiQJgi+hEMQVXW48jONtBGHB779AfWy7sS1 L6EQNqCGZp83KrI8OFBTXA41DJ3gMxhtIRkq1sgEwys4m/mCGi7CDfIPOMtc/MB8rhAp KT+KERQ55mY7vGt2YaTcL3m0RbUAcmgsSeACXW/VsYpN/Ku4fkfqJBRBwmKaKdRPokxO 34SOu5ujzmd4UP5oOaHEMhVBn4w5aepV3FL6jmV3MWcgeyAVofpEnZyNOAL+K5Y4b8Hu mBRaD6P7U7v68U6km23iHSzJqczYBem5QQV+rlLWIa1ffCHsgxSq8hVSbhGcWa7nORHd vakQ== 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 s3-20020a17090699c300b00738466b687dsi3472502ejn.318.2022.08.15.11.34.49; Mon, 15 Aug 2022 11:34:53 -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 3E96168B813; Mon, 15 Aug 2022 21:34:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1D1FB68B813 for ; Mon, 15 Aug 2022 21:34:39 +0300 (EEST) Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4M62xm633rz9sLw for ; Mon, 15 Aug 2022 20:34:36 +0200 (CEST) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Tue, 16 Aug 2022 00:04:10 +0530 Message-Id: <20220815183410.6741-1-ffmpeg@gyani.pro> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4M62xm633rz9sLw Subject: [FFmpeg-devel] [PATCH] ffprobe: restore reporting error code for failed inputs 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: w8gOi1z+l4Cl c11fb46731 led to a regression whereby the return code for missing input or input probe is overridden by writer close return code and hence not conveyed in the exit code. --- fftools/ffprobe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Affects 5.1 so will need to be backported there. diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index ad633ccc44..8983dc28cc 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -4032,7 +4032,7 @@ int main(int argc, char **argv) WriterContext *wctx; char *buf; char *w_name = NULL, *w_args = NULL; - int ret, i; + int ret, input_ret, i; init_dynload(); @@ -4156,10 +4156,14 @@ int main(int argc, char **argv) show_error(wctx, ret); } + input_ret = ret; + writer_print_section_footer(wctx); ret = writer_close(&wctx); if (ret < 0) av_log(NULL, AV_LOG_ERROR, "Writing output failed: %s\n", av_err2str(ret)); + + ret = FFMIN(ret, input_ret); } end: