diff mbox series

[FFmpeg-devel,03/27] fftools/ffmpeg: remove an unnecessary avcodec_close() call

Message ID 20220723140952.31814-3-anton@khirnov.net
State Accepted
Commit 1cd60d3b3511539ee41a94075f7f90b6d25ac2c5
Headers show
Series [FFmpeg-devel,01/27] fftools/ffmpeg: replace AVFrame.pkt_duration with duration | 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 July 23, 2022, 2:09 p.m. UTC
No encoders can possibly be opened at this point. And even if some were,
they would be closed in ffmpeg_cleanup().
---
 fftools/ffmpeg.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 7c340f4570..1cf704ab82 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3344,13 +3344,8 @@  static int transcode_init(void)
 
     /* init input streams */
     for (i = 0; i < nb_input_streams; i++)
-        if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
-            for (i = 0; i < nb_output_streams; i++) {
-                ost = output_streams[i];
-                avcodec_close(ost->enc_ctx);
-            }
+        if ((ret = init_input_stream(i, error, sizeof(error))) < 0)
             goto dump_format;
-        }
 
     /*
      * initialize stream copy and subtitle/data streams.