[FFmpeg-cvslog] avcodec/mpeg12dec: Pass Mpeg1Context* in mpeg_field_start()

Andreas Rheinhardt git at videolan.org
Wed Jun 12 14:16:40 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Apr 28 20:42:41 2024 +0200| [9bb35cfa4d7f8f85ddd59d032a0777af2482d66f] | committer: Andreas Rheinhardt

avcodec/mpeg12dec: Pass Mpeg1Context* in mpeg_field_start()

Avoids a cast.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9bb35cfa4d7f8f85ddd59d032a0777af2482d66f
---

 libavcodec/mpeg12dec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index db93ce1219..851d8d9a77 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1278,10 +1278,10 @@ static int mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
     return 0;
 }
 
-static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
+static int mpeg_field_start(Mpeg1Context *s1, const uint8_t *buf, int buf_size)
 {
+    MpegEncContext *s = &s1->mpeg_enc_ctx;
     AVCodecContext *avctx = s->avctx;
-    Mpeg1Context *s1      = (Mpeg1Context *) s;
     int ret;
 
     if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
@@ -2460,7 +2460,7 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
                 if (s->first_slice) {
                     skip_frame     = 0;
                     s->first_slice = 0;
-                    if ((ret = mpeg_field_start(s2, buf, buf_size)) < 0)
+                    if ((ret = mpeg_field_start(s, buf, buf_size)) < 0)
                         return ret;
                 }
                 if (!s2->cur_pic.ptr) {



More information about the ffmpeg-cvslog mailing list