diff mbox series

[FFmpeg-devel,09/13] avcodec/frame_thread_encoder: Don't shadow variables

Message ID AM7PR03MB66604770DF2B7C12FFF1D67B8FCE9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit f1847dbc1f117d12f32aaba26256cde139628864
Headers show
Series [FFmpeg-devel,01/13] avcodec/vp9: Do not destroy uninitialized mutexes/conditions
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 2, 2021, 3:41 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/frame_thread_encoder.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index 8f8294374f..219d65cce7 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -200,14 +200,13 @@  int ff_frame_thread_encoder_init(AVCodecContext *avctx)
     atomic_init(&c->exit, 0);
 
     c->max_tasks = avctx->thread_count + 2;
-    for (unsigned i = 0; i < c->max_tasks; i++) {
-        if (!(c->tasks[i].indata  = av_frame_alloc()) ||
-            !(c->tasks[i].outdata = av_packet_alloc()))
+    for (unsigned j = 0; j < c->max_tasks; j++) {
+        if (!(c->tasks[j].indata  = av_frame_alloc()) ||
+            !(c->tasks[j].outdata = av_packet_alloc()))
             goto fail;
     }
 
     for(i=0; i<avctx->thread_count ; i++){
-        int ret;
         void *tmpv;
         thread_avctx = avcodec_alloc_context3(avctx->codec);
         if(!thread_avctx)
@@ -221,7 +220,7 @@  int ff_frame_thread_encoder_init(AVCodecContext *avctx)
         if (ret < 0)
             goto fail;
         if (avctx->codec->priv_class) {
-            int ret = av_opt_copy(thread_avctx->priv_data, avctx->priv_data);
+            ret = av_opt_copy(thread_avctx->priv_data, avctx->priv_data);
             if (ret < 0)
                 goto fail;
         }