The branch, release/7.1 has been updated
       via  ab0545969279dc832d431500be11f61e3dadcf91 (commit)
      from  8bb4f60459ec4663476be11cc0fe294d705fa7dd (commit)


- Log -----------------------------------------------------------------
commit ab0545969279dc832d431500be11f61e3dadcf91
Author:     James Almer <jamr...@gmail.com>
AuthorDate: Tue Sep 16 13:56:18 2025 -0300
Commit:     James Almer <jamr...@gmail.com>
CommitDate: Tue Sep 16 15:56:16 2025 -0300

    avcodec/decode: sync initial_pict_type and intra_only_flag with thread 
worker's avctx
    
    Regression since 5acbdd2264d3b90dc11369f9e031e762f260882e, which removed
    setting both values from PerThreadContext.
    Given the pthread code calls ff_decode_receive_frame_internal() on the 
frame,
    any value set before it will be overwritten, so instead sync each thread's
    DecodeContext and let ff_decode_receive_frame_internal() handle these 
values.
    
    Fixes issue #20534.
    
    Signed-off-by: James Almer <jamr...@gmail.com>
    (cherry picked from commit 26f4230082dad1a6a0f2384694037562f73bb2fd)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 828013197c..d8d3bd4d11 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -2329,6 +2329,8 @@ void ff_decode_internal_sync(AVCodecContext *dst, const 
AVCodecContext *src)
     const DecodeContext *src_dc = decode_ctx(src->internal);
     DecodeContext *dst_dc = decode_ctx(dst->internal);
 
+    dst_dc->initial_pict_type = src_dc->initial_pict_type;
+    dst_dc->intra_only_flag   = src_dc->intra_only_flag;
     ff_refstruct_replace(&dst_dc->lcevc, src_dc->lcevc);
 }
 
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 1b1b96623f..5b4b0b342c 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -115,10 +115,6 @@ typedef struct PerThreadContext {
     int hwaccel_threadsafe;
 
     atomic_int debug_threads;       ///< Set if the FF_DEBUG_THREADS option is 
set.
-
-    /// The following two fields have the same semantics as the DecodeContext 
field
-    int intra_only_flag;
-    enum AVPictureType initial_pict_type;
 } PerThreadContext;
 
 /**
@@ -821,13 +817,6 @@ static av_cold int init_thread(PerThreadContext *p, int 
*threads_to_free,
     AVCodecContext *copy;
     int err;
 
-    p->initial_pict_type = AV_PICTURE_TYPE_NONE;
-    if (avctx->codec_descriptor->props & AV_CODEC_PROP_INTRA_ONLY) {
-        p->intra_only_flag = AV_FRAME_FLAG_KEY;
-        if (avctx->codec_type == AVMEDIA_TYPE_VIDEO)
-            p->initial_pict_type = AV_PICTURE_TYPE_I;
-    }
-
     atomic_init(&p->state, STATE_INPUT_READY);
 
     copy = av_memdup(avctx, sizeof(*avctx));

-----------------------------------------------------------------------

Summary of changes:
 libavcodec/decode.c        |  2 ++
 libavcodec/pthread_frame.c | 11 -----------
 2 files changed, 2 insertions(+), 11 deletions(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- ffmpeg-cvslog@ffmpeg.org
To unsubscribe send an email to ffmpeg-cvslog-le...@ffmpeg.org

Reply via email to