diff mbox series

[FFmpeg-devel,3/4] fftools/ffmpeg: fix 2pass log file names

Message ID 20220520093653.26035-3-anton@khirnov.net
State Accepted
Commit e53940186a08a6ea2dd06857965487ff07eb13d8
Headers show
Series [FFmpeg-devel,1/4] tests/fate/vcodec: drop unnecessary options | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov May 20, 2022, 9:36 a.m. UTC
Use the global stream index rather than an unrelated variable in the
filename.

Broken in 6d5d9246042.
---
 fftools/ffmpeg_opt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 47e8b9b7bd..c719bc2d0a 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -1867,7 +1867,7 @@  static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
             snprintf(logfilename, sizeof(logfilename), "%s-%d.log",
                      ost->logfile_prefix ? ost->logfile_prefix :
                                            DEFAULT_PASS_LOGFILENAME_PREFIX,
-                     i);
+                     nb_output_streams - 1);
             if (!strcmp(ost->enc->name, "libx264")) {
                 av_dict_set(&ost->encoder_opts, "stats", logfilename, AV_DICT_DONT_OVERWRITE);
             } else {