On 4/3/2024 5:32 AM, Anton Khirnov wrote:
Quoting James Almer (2024-03-28 17:52:50)
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index fd356bd190..a693e12670 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -334,6 +334,15 @@ FF_ENABLE_DEPRECATION_WARNINGS
      if (for_user) {
          if (codec->update_thread_context_for_user)
              err = codec->update_thread_context_for_user(dst, src);
+
+        av_frame_side_data_free(&dst->decoded_side_data, 
&dst->nb_decoded_side_data);
+        for (int i = 0; i < src->nb_decoded_side_data; i++) {
+            int ret = av_frame_side_data_clone(&dst->decoded_side_data,
+                                               &dst->nb_decoded_side_data,
+                                               src->decoded_side_data[i], 0);
+            if (ret < 0)
+                return ret;
+        }

Seems wasteful to do this for every frame, when it only needs to be done
once. Is there a reason not to put this code in init_thread()?

Hadn't thought about it. Will try that.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to