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

@@ -3462,10 +3462,8 @@ static int need_output(void)
for (i = 0; i < nb_output_streams; i++) {
OutputStream *ost = output_streams[i];
OutputFile *of = output_files[ost->file_index];
AVFormatContext *os = output_files[ost->file_index]->ctx;
if (ost->finished ||
(os->pb && avio_tell(os->pb) >= of->limit_filesize))
if (ost->finished || of_finished(of))
continue;
if (ost->frame_number >= ost->max_frames) {
int j;