diff mbox series

[FFmpeg-devel,v2,2/8] lavc/vaapi_decode: Use a more meaningful variable name

Message ID 20240918071031.1377336-2-fei.w.wang@intel.com
State New
Headers show
Series [FFmpeg-devel,v2,1/8] lavc/vaapi_dec: Create VA parameters dynamically | 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

Wang, Fei W Sept. 18, 2024, 7:10 a.m. UTC
From: Fei Wang <fei.w.wang@intel.com>

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
---
 libavcodec/vaapi_decode.c | 20 ++++++++++----------
 libavcodec/vaapi_decode.h |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index 709699dcaf..7753f72106 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -84,19 +84,19 @@  int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
     VAStatus vas;
     int index;
 
-    av_assert0(pic->nb_slices <= pic->slices_allocated);
-    if (pic->nb_slices == pic->slices_allocated) {
+    av_assert0(pic->nb_slices <= pic->nb_slice_buffers_allocated);
+    if (pic->nb_slices == pic->nb_slice_buffers_allocated) {
         VABufferID *tmp =
             av_realloc_array(pic->slice_buffers,
-                             pic->slices_allocated ? pic->slices_allocated * 2 : 64,
+                             pic->nb_slice_buffers_allocated ? pic->nb_slice_buffers_allocated * 2 : 64,
                              2 * sizeof(*pic->slice_buffers));
         if (!tmp)
             return AVERROR(ENOMEM);
 
-        pic->slice_buffers    = tmp;
-        pic->slices_allocated = pic->slices_allocated ? pic->slices_allocated * 2 : 64;
+        pic->slice_buffers = tmp;
+        pic->nb_slice_buffers_allocated = pic->nb_slice_buffers_allocated ? pic->nb_slice_buffers_allocated * 2 : 64;
     }
-    av_assert0(pic->nb_slices + 1 <= pic->slices_allocated);
+    av_assert0(pic->nb_slices + 1 <= pic->nb_slice_buffers_allocated);
 
     index = 2 * pic->nb_slices;
 
@@ -237,8 +237,8 @@  exit:
     pic->nb_param_buffers           = 0;
     pic->nb_param_buffers_allocated = 0;
     av_freep(&pic->param_buffers);
-    pic->nb_slices        = 0;
-    pic->slices_allocated = 0;
+    pic->nb_slices                  = 0;
+    pic->nb_slice_buffers_allocated = 0;
     av_freep(&pic->slice_buffers);
 
     return err;
@@ -252,8 +252,8 @@  int ff_vaapi_decode_cancel(AVCodecContext *avctx,
     pic->nb_param_buffers           = 0;
     pic->nb_param_buffers_allocated = 0;
     av_freep(&pic->param_buffers);
-    pic->nb_slices        = 0;
-    pic->slices_allocated = 0;
+    pic->nb_slices                  = 0;
+    pic->nb_slice_buffers_allocated = 0;
     av_freep(&pic->slice_buffers);
 
     return 0;
diff --git a/libavcodec/vaapi_decode.h b/libavcodec/vaapi_decode.h
index a373eb5d6b..7813473c98 100644
--- a/libavcodec/vaapi_decode.h
+++ b/libavcodec/vaapi_decode.h
@@ -41,7 +41,7 @@  typedef struct VAAPIDecodePicture {
 
     int                nb_slices;
     VABufferID           *slice_buffers;
-    int                   slices_allocated;
+    int                   nb_slice_buffers_allocated;
 } VAAPIDecodePicture;
 
 typedef struct VAAPIDecodeContext {