diff mbox series

[FFmpeg-devel,11/12] avcodec/h261dec, mpeg12dec, vc1dec: Remove setting write-only flags

Message ID AS8P250MB074445F48431D31085082B0C8FC4A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit f0f6acde1ac41b9313400463da725993cbf9b8d1
Headers show
Series [FFmpeg-devel,1/4] avcodec/mpegvideo_dec: Check for existence of planes before accesses | expand

Checks

Context Check Description
yinshiyou/commit_msg_loongarch64 warning The first line of the commit message must start with a context terminated by a colon and a space, for example "lavu/opt: " or "doc: ".

Commit Message

Andreas Rheinhardt Oct. 3, 2023, 4:04 p.m. UTC
These flags will be overwritten later in ff_mpv_frame_start().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/h261dec.c   |  7 -------
 libavcodec/mpeg12dec.c | 10 ----------
 libavcodec/vc1dec.c    |  7 -------
 3 files changed, 24 deletions(-)

Comments

Michael Niedermayer Oct. 4, 2023, 5:26 p.m. UTC | #1
On Tue, Oct 03, 2023 at 06:04:03PM +0200, Andreas Rheinhardt wrote:
> These flags will be overwritten later in ff_mpv_frame_start().
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/h261dec.c   |  7 -------
>  libavcodec/mpeg12dec.c | 10 ----------
>  libavcodec/vc1dec.c    |  7 -------
>  3 files changed, 24 deletions(-)

probably ok

[...]
diff mbox series

Patch

diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 6cdf11f822..447e168c4f 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -640,13 +640,6 @@  retry:
         goto retry;
     }
 
-    // for skipping the frame
-    s->current_picture.f->pict_type = s->pict_type;
-    if (s->pict_type == AV_PICTURE_TYPE_I)
-        s->current_picture.f->flags |= AV_FRAME_FLAG_KEY;
-    else
-        s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY;
-
     if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||
         (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) ||
          avctx->skip_frame >= AVDISCARD_ALL)
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index c0f1e8763b..5dac83ebcd 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1326,11 +1326,6 @@  static int mpeg1_decode_picture(AVCodecContext *avctx, const uint8_t *buf,
         s->mpeg_f_code[1][0] = f_code;
         s->mpeg_f_code[1][1] = f_code;
     }
-    s->current_picture.f->pict_type = s->pict_type;
-    if (s->pict_type == AV_PICTURE_TYPE_I)
-        s->current_picture.f->flags |= AV_FRAME_FLAG_KEY;
-    else
-        s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY;
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
         av_log(avctx, AV_LOG_DEBUG,
@@ -1504,11 +1499,6 @@  static int mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
                 s->pict_type = AV_PICTURE_TYPE_P;
         } else
             s->pict_type = AV_PICTURE_TYPE_B;
-        s->current_picture.f->pict_type = s->pict_type;
-        if (s->pict_type == AV_PICTURE_TYPE_I)
-            s->current_picture.f->flags |= AV_FRAME_FLAG_KEY;
-        else
-            s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY;
     }
 
     s->intra_dc_precision         = get_bits(&s->gb, 2);
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index a4f2d30e22..534128d6ee 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1058,13 +1058,6 @@  static int vc1_decode_frame(AVCodecContext *avctx, AVFrame *pict,
         goto err;
     }
 
-    // for skipping the frame
-    s->current_picture.f->pict_type = s->pict_type;
-    if (s->pict_type == AV_PICTURE_TYPE_I)
-        s->current_picture.f->flags |= AV_FRAME_FLAG_KEY;
-    else
-        s->current_picture.f->flags &= ~AV_FRAME_FLAG_KEY;
-
     /* skip B-frames if we don't have reference frames */
     if (!s->last_picture_ptr && s->pict_type == AV_PICTURE_TYPE_B) {
         av_log(v->s.avctx, AV_LOG_DEBUG, "Skipping B frame without reference frames\n");