[FFmpeg-cvslog] ffprobe: restore reporting error code for failed inputs

Gyan Doshi git at videolan.org
Wed Aug 17 14:18:17 EEST 2022


ffmpeg | branch: release/5.1 | Gyan Doshi <ffmpeg at gyani.pro> | Tue Aug 16 00:14:16 2022 +0530| [4e4cc6e56a899f6b4302e80dbcd6b4462f340905] | committer: Gyan Doshi

ffprobe: restore reporting error code for failed inputs

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e4cc6e56a899f6b4302e80dbcd6b4462f340905
---

 fftools/ffprobe.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index f156663019..608d9050f7 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -4026,7 +4026,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();
 
@@ -4150,10 +4150,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:



More information about the ffmpeg-cvslog mailing list