[FFmpeg-cvslog] ffprobe: simplify branching logic in probe_file()

Stefano Sabatini git at videolan.org
Thu Jun 27 00:26:42 CEST 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Thu Jun 27 00:09:49 2013 +0200| [205092bf478f444fb8e6f4d0f45f07fac27be352] | committer: Stefano Sabatini

ffprobe: simplify branching logic in probe_file()

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

 ffprobe.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/ffprobe.c b/ffprobe.c
index 98c4a49..d2a682b 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1904,7 +1904,10 @@ static int probe_file(WriterContext *wctx, const char *filename)
     do_read_packets = do_show_packets || do_count_packets;
 
     ret = open_input_file(&fmt_ctx, filename);
-    if (ret >= 0) {
+    if (ret < 0)
+        return ret;
+
+    /* todo: reindent */
         nb_streams_frames  = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_frames));
         nb_streams_packets = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_packets));
         selected_streams   = av_calloc(fmt_ctx->nb_streams, sizeof(*selected_streams));
@@ -1949,7 +1952,7 @@ static int probe_file(WriterContext *wctx, const char *filename)
         av_freep(&nb_streams_frames);
         av_freep(&nb_streams_packets);
         av_freep(&selected_streams);
-    }
+
     return ret;
 }
 



More information about the ffmpeg-cvslog mailing list