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

Git pushed a commit to branch release/7.1
in repository ffmpeg.

commit 09dc319bf3de78803f7f6a637e2cafdc441499e5
Author:     James Almer <[email protected]>
AuthorDate: Sat Jan 10 15:48:46 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Mon Jan 12 20:53:46 2026 -0300

    avfilter/vf_lcevc: attach a reference to the source frame to each passed in 
base picture
    
    And free them once they are guaranteed to be no longer needed, instead of 
freeing them
    when returned with an enhanced output.
    
    Signed-off-by: James Almer <[email protected]>
    (cherry picked from commit af136db1c3c5d72c4a71cedaf7b06d2f8ae3819e)
---
 libavfilter/vf_lcevc.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_lcevc.c b/libavfilter/vf_lcevc.c
index 5fe8a0a868..318b144374 100644
--- a/libavfilter/vf_lcevc.c
+++ b/libavfilter/vf_lcevc.c
@@ -152,6 +152,13 @@ static int send_frame(AVFilterLink *inlink, AVFrame *in)
         }
     }
 
+    res = LCEVC_SetPictureUserData(lcevc->decoder, picture, in);
+    if (res != LCEVC_Success) {
+        av_log(ctx, AV_LOG_ERROR, "LCEVC_SetPictureUserData failed\n");
+        LCEVC_FreePicture(lcevc->decoder, picture);
+        return AVERROR_EXTERNAL;
+    }
+
 #ifdef LCEVC_DEC_VERSION_MAJOR
     res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, in);
 #else
@@ -223,8 +230,6 @@ static int generate_output(AVFilterLink *inlink, AVFrame 
*out)
     av_frame_copy_props(out, (AVFrame *)info.baseUserData);
     av_frame_remove_side_data(out, AV_FRAME_DATA_LCEVC);
 
-    av_frame_free((AVFrame **)&info.baseUserData);
-
     res = LCEVC_GetPictureDesc(lcevc->decoder, picture, &desc);
     LCEVC_FreePicture(lcevc->decoder, picture);
 
@@ -292,8 +297,12 @@ static void flush_bases(AVFilterContext *ctx)
     LCEVCContext *lcevc = ctx->priv;
     LCEVC_PictureHandle picture;
 
-    while (LCEVC_ReceiveDecoderBase(lcevc->decoder, &picture) == LCEVC_Success)
+    while (LCEVC_ReceiveDecoderBase(lcevc->decoder, &picture) == 
LCEVC_Success) {
+        AVFrame *base = NULL;
+        LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
         LCEVC_FreePicture(lcevc->decoder, picture);
+        av_frame_free(&base);
+    }
 }
 
 static int activate(AVFilterContext *ctx)
@@ -407,6 +416,8 @@ static av_cold void uninit(AVFilterContext *ctx)
 {
     LCEVCContext *lcevc = ctx->priv;
 
+    LCEVC_FlushDecoder(lcevc->decoder);
+    flush_bases(ctx);
     LCEVC_DestroyDecoder(lcevc->decoder);
 }
 

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

Reply via email to