summaryrefslogtreecommitdiff
path: root/ffprobe.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2011-12-29 12:50:25 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-01-04 01:05:56 +0100
commit90347dabc8a41c03e4d282c301de917cd9b9e21b (patch)
tree44c0ef435e9460192d0ffde577496e150ca86902 /ffprobe.c
parentc972f91d5bd652dcb6f15ab603378db3b2e76e04 (diff)
ffprobe: change order of operations in probe_file()
This is required by a pending patch, also fixes a memleak due to the writer context not being closed in case of open_input_file() failure.
Diffstat (limited to 'ffprobe.c')
-rw-r--r--ffprobe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ffprobe.c b/ffprobe.c
index ddeaeee7b8..42832d7390 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1399,16 +1399,16 @@ static int probe_file(const char *filename)
if ((ret = writer_open(&wctx, w, w_args, NULL)) < 0)
goto end;
- if ((ret = open_input_file(&fmt_ctx, filename)))
- goto end;
writer_print_header(wctx);
+ ret = open_input_file(&fmt_ctx, filename);
+ if (ret >= 0) {
PRINT_CHAPTER(packets);
PRINT_CHAPTER(streams);
PRINT_CHAPTER(format);
- writer_print_footer(wctx);
-
avformat_close_input(&fmt_ctx);
+ }
+ writer_print_footer(wctx);
writer_close(&wctx);
end: