This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 2d062dd0c6bfc372026c67c70e16a496ce8cc88a
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Wed Apr 15 15:02:04 2026 +0200
Commit:     James Almer <[email protected]>
CommitDate: Thu Apr 16 19:27:03 2026 +0000

    avcodec/decode: Make post_process_opaque a RefStruct reference
    
    Avoids the post_process_opaque_free callback; the only user of
    this is already a RefStruct reference and presumably other users
    would want to use a pool for this, too, so they would use
    RefStruct-objects, too.
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/decode.c   | 4 +---
 libavcodec/decode.h   | 3 +--
 libavcodec/lcevcdec.c | 6 ------
 libavcodec/lcevcdec.h | 2 +-
 4 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 892f6fce1d..b7392cae23 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1676,8 +1676,7 @@ static void decode_data_free(AVRefStructOpaque unused, 
void *obj)
 {
     FrameDecodeData *fdd = obj;
 
-    if (fdd->post_process_opaque_free)
-        fdd->post_process_opaque_free(fdd->post_process_opaque);
+    av_refstruct_unref(&fdd->post_process_opaque);
 
     if (fdd->hwaccel_priv_free)
         fdd->hwaccel_priv_free(fdd->hwaccel_priv);
@@ -1748,7 +1747,6 @@ int ff_attach_decode_data(AVCodecContext *avctx, AVFrame 
*frame)
         validate_avframe_allocation(avctx, frame_ctx->frame);
 
         fdd->post_process_opaque = frame_ctx;
-        fdd->post_process_opaque_free = ff_lcevc_unref;
         fdd->post_process = ff_lcevc_process;
     }
     dc->lcevc.frame = 0;
diff --git a/libavcodec/decode.h b/libavcodec/decode.h
index 5a7ab64c29..b4ae0ba8fe 100644
--- a/libavcodec/decode.h
+++ b/libavcodec/decode.h
@@ -42,8 +42,7 @@ typedef struct FrameDecodeData {
      * stored in the post_process_opaque object.
      */
     int (*post_process)(void *logctx, AVFrame *frame);
-    void *post_process_opaque;
-    void (*post_process_opaque_free)(void *opaque);
+    void *post_process_opaque;                        ///< RefStruct reference
 
     /**
      * Per-frame private data for hwaccels.
diff --git a/libavcodec/lcevcdec.c b/libavcodec/lcevcdec.c
index 270a7be81b..9cc23f7f10 100644
--- a/libavcodec/lcevcdec.c
+++ b/libavcodec/lcevcdec.c
@@ -464,9 +464,3 @@ fail:
     av_refstruct_unref(&lcevc);
     return ret;
 }
-
-void ff_lcevc_unref(void *opaque)
-{
-    FFLCEVCFrame *lcevc = opaque;
-    av_refstruct_unref(&lcevc);
-}
diff --git a/libavcodec/lcevcdec.h b/libavcodec/lcevcdec.h
index 5aed07f999..3120f423d1 100644
--- a/libavcodec/lcevcdec.h
+++ b/libavcodec/lcevcdec.h
@@ -50,5 +50,5 @@ int ff_lcevc_alloc(FFLCEVCContext **plcevc, void *logctx);
 int ff_lcevc_process(void *logctx, struct AVFrame *frame);
 int ff_lcevc_parse_frame(FFLCEVCContext *lcevc, const struct AVFrame *frame,
                          enum AVPixelFormat *format, int *width, int *height, 
void *logctx);
-void ff_lcevc_unref(void *opaque);
+
 #endif /* AVCODEC_LCEVCDEC_H */

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to