diff mbox series

[FFmpeg-devel,1/7] avcodec/wmv2dec: Parse extradata during init

Message ID AS8P250MB07449BD309DE98BE5A7D6D468FC8A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit cae30c5ed234f2c5524ab2af673ebf5738739a39
Headers show
Series [FFmpeg-devel,1/7] avcodec/wmv2dec: Parse extradata during init | expand

Commit Message

Andreas Rheinhardt Oct. 7, 2023, 12:37 a.m. UTC
And stop setting picture_number which was only done to not parse
extradata multiple times.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/wmv2dec.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Michael Niedermayer Oct. 8, 2023, 4:45 p.m. UTC | #1
On Sat, Oct 07, 2023 at 02:37:39AM +0200, Andreas Rheinhardt wrote:
> And stop setting picture_number which was only done to not parse
> extradata multiple times.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/wmv2dec.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

should be ok

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 469b2c4b2b..934bf56b1a 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -203,12 +203,8 @@  static int decode_ext_header(WMV2DecContext *w)
 
 int ff_wmv2_decode_picture_header(MpegEncContext *s)
 {
-    WMV2DecContext *const w = (WMV2DecContext *) s;
     int code;
 
-    if (s->picture_number == 0)
-        decode_ext_header(w);
-
     s->pict_type = get_bits1(&s->gb) + 1;
     if (s->pict_type == AV_PICTURE_TYPE_I) {
         code = get_bits(&s->gb, 7);
@@ -333,7 +329,6 @@  int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
     }
     s->esc3_level_length = 0;
     s->esc3_run_length   = 0;
-    s->picture_number++; // FIXME ?
 
     if (w->j_type) {
         ff_intrax8_decode_picture(&w->x8, &s->current_picture,
@@ -578,6 +573,8 @@  static av_cold int wmv2_decode_init(AVCodecContext *avctx)
 
     ff_wmv2_common_init(s);
 
+    decode_ext_header(w);
+
     return ff_intrax8_common_init(avctx, &w->x8,
                                   w->s.block, w->s.block_last_index,
                                   w->s.mb_width, w->s.mb_height);