summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-12-13 15:13:37 +0100
committerAnton Khirnov <anton@khirnov.net>2022-07-23 11:53:19 +0200
commitcc1cc2c65e7b776433791adea932e0ea9b1cfd42 (patch)
tree88bb736a3f220de6980442a09fdcef057aafe2bc /fftools/ffmpeg.c
parentcc4964607724980aae242777af9b35567b2fc627 (diff)
fftools/ffmpeg: move closing the file into of_write_trailer()
The current code postpones closing the files until after printing the final report, which accesses the output file size. Deal with this by storing the final file size before closing the file.
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r--fftools/ffmpeg.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index b93b453e05..a2b8fa99b9 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4312,7 +4312,6 @@ static int transcode_step(void)
static int transcode(void)
{
int ret, i;
- AVFormatContext *os;
OutputStream *ost;
InputStream *ist;
int64_t timer_start;
@@ -4381,18 +4380,6 @@ static int transcode(void)
/* dump report by using the first video and audio streams */
print_report(1, timer_start, av_gettime_relative());
- /* close the output files */
- for (i = 0; i < nb_output_files; i++) {
- os = output_files[i]->ctx;
- if (os && os->oformat && !(os->oformat->flags & AVFMT_NOFILE)) {
- if ((ret = avio_closep(&os->pb)) < 0) {
- av_log(NULL, AV_LOG_ERROR, "Error closing file %s: %s\n", os->url, av_err2str(ret));
- if (exit_on_error)
- exit_program(1);
- }
- }
- }
-
/* close each encoder */
for (i = 0; i < nb_output_streams; i++) {
ost = output_streams[i];