fftools/ffmpeg: refactor limiting output file size with -fs

Move the file size checking code to ffmpeg_mux. Use the recently
introduced of_filesize(), making this code consistent with the size
shown by print_report().
This commit is contained in:
Anton Khirnov
2021-12-11 14:12:08 +01:00
parent 81af4dec27
commit d8e944c238
4 changed files with 14 additions and 8 deletions

View File

@@ -2403,7 +2403,6 @@ static int open_output_file(OptionsContext *o, const char *filename)
of->ost_index = nb_output_streams;
of->recording_time = o->recording_time;
of->start_time = o->start_time;
of->limit_filesize = o->limit_filesize;
of->shortest = o->shortest;
av_dict_copy(&of->opts, o->g->format_opts, 0);
@@ -3006,7 +3005,7 @@ loop_end:
exit_program(1);
}
err = of_muxer_init(of);
err = of_muxer_init(of, o->limit_filesize);
if (err < 0) {
av_log(NULL, AV_LOG_FATAL, "Error initializing internal muxing state\n");
exit_program(1);