From patchwork Mon Jun 13 21:04:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 36203 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp706610pzb; Mon, 13 Jun 2022 14:05:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLxqieBPb9mkpfYSvGMDAslWfj9maWWDLqo2bQDUB6Roy+lVkUkHqUX3f5dSNNLySPTIml X-Received: by 2002:a17:906:ced1:b0:710:f654:87ef with SMTP id si17-20020a170906ced100b00710f65487efmr1478495ejb.194.1655154315253; Mon, 13 Jun 2022 14:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655154315; cv=none; d=google.com; s=arc-20160816; b=rY4l8th/2QJjxXxk+jP8hXwVVmom6XeEbgV9xW89gtOp7lp7+z3LbWTFNrRAiiyAl3 1bfgIG4G5N5yY2TmMo5GJBt2G9OirecA3P3acupTNBtO1FD1VXo4iJFJW7ypV4jaJ83O fc52cvTOYE3V/1lRIm4cn7CHoRYsT9lkwB1tTrDgaDjc2GDgk67peIHv1FAKcCsqTAAH FGIoa6qgZ8Vk6gIRyINaK+hOX7TRU/fB/AxHxXvhjl1cuApRBczxlrolAlfL0rupPeaJ vu5TujJLTr4vpxKZOI+UWHb2e2q/549iw1Cf5GyB7KtjkyjQGhhaoYc/sOn4DBLX18W/ sduw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=6MK3RQ3ba9h4DISnL1qWrELzyE7UXKMbb7NmmaqMCGI=; b=gzj6YBfVPiiv+ix8/De38VdSIi+zI+iycRnpZEQ/nCZDL1dvj68lkBFYzQc9Zmve85 jMkIJgjlzsVfbPpf0vc6xVAqouwPDrjZKx1eZB6Hi3qqAE01YtXCIsHjtN6MDUoQdMLd 0ouqqJ0GsazeuPn16UGjCDvKrbkA8G+W72TQbUcai7CO1oS0/V2DG91sWTv/f+GQlwVQ bXBR5TiSdNHmqi73aos7+vdRyi8kA6RMvsIMcRigiRYHSM/C9HsHfOitqJ0NzPFL/ese 3C2owwAl+AvLOR581p3Ndm+yipiOUQKTIlj62w6gxZffrDEUO379sCDnOolxSvN02VIn dEvw== 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 ga19-20020a1709070c1300b00707e87fe126si10514932ejc.99.2022.06.13.14.05.14; Mon, 13 Jun 2022 14:05:15 -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 A165168B5E1; Tue, 14 Jun 2022 00:05:11 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B265768B081 for ; Tue, 14 Jun 2022 00:05:04 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 24586E6BE2; Mon, 13 Jun 2022 23:05:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DOayZuqzNx1O; Mon, 13 Jun 2022 23:05:03 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 72D42E6B1A; Mon, 13 Jun 2022 23:05:03 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Jun 2022 23:04:55 +0200 Message-Id: <20220613210455.31216-1-cus@passwd.hu> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] fftools/ffprobe: report avio errors 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: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: YaXY+9iCWCEc Signed-off-by: Marton Balint --- fftools/ffprobe.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c index 4e2fdbaec8..5020ba484c 100644 --- a/fftools/ffprobe.c +++ b/fftools/ffprobe.c @@ -545,12 +545,13 @@ static const AVClass writer_class = { .child_next = writer_child_next, }; -static void writer_close(WriterContext **wctx) +static int writer_close(WriterContext **wctx) { int i; + int ret = 0; if (!*wctx) - return; + return -1; if ((*wctx)->writer->uninit) (*wctx)->writer->uninit(*wctx); @@ -562,9 +563,10 @@ static void writer_close(WriterContext **wctx) av_opt_free(*wctx); if ((*wctx)->avio) { avio_flush((*wctx)->avio); - avio_close((*wctx)->avio); + ret = avio_close((*wctx)->avio); } av_freep(wctx); + return ret; } static void bprint_bytes(AVBPrint *bp, const uint8_t *ubuf, size_t ubuf_size) @@ -4145,7 +4147,9 @@ int main(int argc, char **argv) } writer_print_section_footer(wctx); - writer_close(&wctx); + ret = writer_close(&wctx); + if (ret < 0) + av_log(NULL, AV_LOG_ERROR, "Writing output failed: %s\n", av_err2str(ret)); } end: