mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-30 03:12:08 +00:00
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.
This commit is contained in:
parent
c972f91d5b
commit
90347dabc8
@ -1399,16 +1399,16 @@ static int probe_file(const char *filename)
|
|||||||
|
|
||||||
if ((ret = writer_open(&wctx, w, w_args, NULL)) < 0)
|
if ((ret = writer_open(&wctx, w, w_args, NULL)) < 0)
|
||||||
goto end;
|
goto end;
|
||||||
if ((ret = open_input_file(&fmt_ctx, filename)))
|
|
||||||
goto end;
|
|
||||||
|
|
||||||
writer_print_header(wctx);
|
writer_print_header(wctx);
|
||||||
|
ret = open_input_file(&fmt_ctx, filename);
|
||||||
|
if (ret >= 0) {
|
||||||
PRINT_CHAPTER(packets);
|
PRINT_CHAPTER(packets);
|
||||||
PRINT_CHAPTER(streams);
|
PRINT_CHAPTER(streams);
|
||||||
PRINT_CHAPTER(format);
|
PRINT_CHAPTER(format);
|
||||||
writer_print_footer(wctx);
|
|
||||||
|
|
||||||
avformat_close_input(&fmt_ctx);
|
avformat_close_input(&fmt_ctx);
|
||||||
|
}
|
||||||
|
writer_print_footer(wctx);
|
||||||
writer_close(&wctx);
|
writer_close(&wctx);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
Loading…
Reference in New Issue
Block a user