From c241796a2da4fb5865f1922700f4121f7c4bd444 Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Tue, 14 Jan 2025 11:28:21 +0100
Subject: [PATCH 1/2] avcodec/video: use frame flags instead of fields

The structure fields are deprecated.
It was introduced in lavu 58.7.100.

(cherry picked from commit c79659bc9cfa2ff14754920a706f89d07d6425e6)
---
 modules/codec/avcodec/video.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 8524f575bd..dfd359cfcd 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1431,8 +1431,13 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block, bool *error
         /* Hack to force display of still pictures */
         p_pic->b_force = p_sys->b_first_frame;
         p_pic->i_nb_fields = 2 + frame->repeat_pict;
+#if LIBAVUTIL_VERSION_CHECK( 58, 7, 100 )
+        p_pic->b_progressive = !(frame->flags & AV_FRAME_FLAG_INTERLACED);
+        p_pic->b_top_field_first = !!(frame->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST);
+#else
         p_pic->b_progressive = !frame->interlaced_frame;
         p_pic->b_top_field_first = frame->top_field_first;
+#endif
 
         if (DecodeSidedata(p_dec, frame, p_pic))
             i_pts = VLC_TICK_INVALID;
-- 
2.52.0
