[FFmpeg-devel] [PATCH 08/21] fftools/ffmpeg_dec: remove pointless InputStream.hwaccel_retrieve_data

Anton Khirnov anton at khirnov.net
Wed Jun 14 19:48:55 EEST 2023


It is always set to hwaccel_retrieve_data() from ffmpeg_hw.c, so that
function can just be called directly instead.
---
 fftools/ffmpeg.h     | 1 -
 fftools/ffmpeg_dec.c | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index aeecf92fe6..2559225dd6 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -393,7 +393,6 @@ typedef struct InputStream {
     char  *hwaccel_device;
     enum AVPixelFormat hwaccel_output_format;
 
-    int  (*hwaccel_retrieve_data)(AVCodecContext *s, AVFrame *frame);
     enum AVPixelFormat hwaccel_pix_fmt;
 
     /* stats */
diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c
index ca9fbb9bd8..85132050d8 100644
--- a/fftools/ffmpeg_dec.c
+++ b/fftools/ffmpeg_dec.c
@@ -272,8 +272,8 @@ static int video_frame_process(InputStream *ist, AVFrame *frame)
     if(ist->top_field_first>=0)
         frame->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
 
-    if (ist->hwaccel_retrieve_data && frame->format == ist->hwaccel_pix_fmt) {
-        int err = ist->hwaccel_retrieve_data(ist->dec_ctx, frame);
+    if (frame->format == ist->hwaccel_pix_fmt) {
+        int err = hwaccel_retrieve_data(ist->dec_ctx, frame);
         if (err < 0)
             return err;
     }
@@ -561,7 +561,6 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat
             }
         }
         if (config && config->device_type == ist->hwaccel_device_type) {
-            ist->hwaccel_retrieve_data = hwaccel_retrieve_data;
             ist->hwaccel_pix_fmt = *p;
             break;
         }
-- 
2.40.1



More information about the ffmpeg-devel mailing list